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

weight权重文件 #49

Open
ZhongmingZhan opened this issue Sep 19, 2023 · 3 comments
Open

weight权重文件 #49

ZhongmingZhan opened this issue Sep 19, 2023 · 3 comments

Comments

@ZhongmingZhan
Copy link

ZhongmingZhan commented Sep 19, 2023

作者你好,使用yolov5s.pt导出的onnx模型替换到您的yolov5s.onnx会报错“terminate called after throwing an instance of 'cv::Exception'
what(): OpenCV(3.4.16) /home/db/opencv/opencv-3.4.16/modules/dnn/src/dnn.cpp:1406: error: (-2:Unspecified error) Requested layer "output" not found in function 'getLayerData'”,请问这是为什么,应该怎样修改。

@KinokoC
Copy link

KinokoC commented Mar 8, 2024

用v5 7.0版本的官方脚本导出的onnx模型输出的命名是output0,我把官方export.py line 173后面的output0改为output后再导出的就可以了。把作者代码里的取的输出名改为output0应该也行,你可以试试。

@YangSangWan
Copy link

作者你好,使用yolov5s.pt导出的onnx模型替换到您的yolov5s.onnx会报错“terminate called after throwing an instance of 'cv::Exception' what(): OpenCV(3.4.16) /home/db/opencv/opencv-3.4.16/modules/dnn/src/dnn.cpp:1406: error: (-2:Unspecified error) Requested layer "output" not found in function 'getLayerData'”,请问这是为什么,应该怎样修改。

edit file YOLOv5Detector.cpp

cv::Mat preds = this->net.forward("output");  

->  cv::Mat preds = this->net.forward("output0");

@Li-Chang-Yi
Copy link

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

4 participants