Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

atlas 300i pro跑yolov5.onnx模型推理出错 #2427

Open
PeterFive opened this issue Apr 9, 2024 · 2 comments
Open

atlas 300i pro跑yolov5.onnx模型推理出错 #2427

PeterFive opened this issue Apr 9, 2024 · 2 comments
Assignees

Comments

@PeterFive
Copy link

PeterFive commented Apr 9, 2024

环境

  • 【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.
@PeterFive PeterFive changed the title Ascend 300i pro跑yolov5.onnx模型推理出错 atlas 300i pro跑yolov5.onnx模型推理出错 Apr 9, 2024
@juncaipeng
Copy link
Collaborator

这个后端只支持yolov5s_infer模型,没有支持yolov5n

@PeterFive
Copy link
Author

这个后端只支持yolov5s_infer模型,没有支持yolov5n

抱歉我不是很明白,是不支持onnx模型(我需要将ONNX转成paddle inference model才可用),还是说支持yolov5s.onnx不支持yolov5n.onnx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants