PaddlePaddle / PaddlePaddle/FastDeploy
atlas 300i pro跑yolov5.onnx模型推理出错
Open
@juncaipeng is already working on this.
Since Apr 9, 2024.
- Dominant language
- Python
- Stars
- 3.7k
- Forks
- 756
- Avg merge
- 19h 28m
- Merged PRs (30d)
- 4
Description
环境
- 【FastDeploy版本】: fastdeploy-python ==0.0.0
- 【系统平台】: Linux aarch64(Ubuntu 18.04)
- 【硬件】: atlas 300i pro推理卡 cann6.0.1
- 【编译语言】: Python3.7.5
出现问题的操作流程
- 【模型跑不通】
-
- 先执行
examples下的部署示例,使用examples提供的模型,可以执行成功
- 先执行
-
examples下的示例python infer.py --model yolov5s_infer --image 000000014439.jpg --device ascend可以运行,换成了paddle提供的yolov5的onnx文件(yolov5n.onnx),代码报错
-
- 这是测试代码
import fastdeploy as fd
import cv2
option = fd.RuntimeOption()
option.use_ascend()
model = fd.vision.detection.YOLOv5(
"./yolov5n.onnx",
params_file="",
runtime_option=option,
model_format=fd.ModelFormat.ONNX)
image = './1.jpg'
im = cv2.imread(image)
result = model.predict(im, conf_threshold=0.25, nms_iou_threshold=0.5)
vis_im = fd.vision.vis_detection(im, result)
cv2.imwrite("visualized_result_monkey.jpg", vis_im)
print("Visualized result save in ./visualized_result_monkey.jpg")
--报错信息
[ERROR] fastdeploy/fastdeploy_model.cc(385)::CreateASCENDBackend There's no valid ascend backends for model: yolov5
[ERROR] fastdeploy/vision/detection/contrib/yolov5/yolov5.cc(45)::Initialize Failed to initialize fastdeploy backend.
Traceback (most recent call last):
File "test.py", line 10, in <module>
model_format=fd.ModelFormat.ONNX)
File "/usr/local/python3.7.5/lib/python3.7/site-packages/fastdeploy/vision/detection/contrib/yolov5.py", line 184, in __init__
assert self.initialized, "YOLOv5 initialize failed."
AssertionError: YOLOv5 initialize failed.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.