hi! I want to convert yolov5s to openvino. First it will convert to onnx, it is no problem, ans then when i convert onnx to openvino. It occurs problem.
Sorry buddy, can't help, no experience. If you get this to work it might be useful to write a tutorial that we could add to https://github.com/ultralytics/yolov5#tutorials to help others.
ha, I am faced with the same problem.
A possible way is that, the node 'Upsampling' with nearest mode can be converted to 'Upsampling' op(in ONNX) not the 'resize' op. It seemed that there is bug when 'resize' op in ONNX--->'interpolate' op in OPENVINO. And the Upsampling op in ONNX is ok.
Another way is that do not use the Upsampling op in Pytorch. You can copy the value like https://github.com/dmlc/gluon-cv/blob/master/gluoncv/model_zoo/yolo/yolo3.py#L31
I update the openvino to 2020R4, it is solved
@linhaoqi027 which opset value you used in converting to onnx. I'm facing the issues when convert yolov5 .pth model to openvino with opset = 10 (can't convert full the model). If I use opset = 11 or 12, I can conver full model to onnx but meet error resize operator only support for opset = 10 in openvino 2020R4.
Could you pls give your script convert to openvino ?
opset=10
I can convert to openvino
@linhaoqi027 thanks. I also use opset = 10 now, but I have trouble on final result after converting openvino model. I can output 3 features map from converted model and then apply some numpy calculation & nms step to output bounding bo (followed #343 ) . But its seems NMS step doesn't working. Could you share your script to inference of converted openvino model ? if possile, could you give me your contact ? Thank you in advance !!!

@anhnktp can you tell me please if you have output with 5d shape like 1x80x80x3x7 cause i have an error when i run my transformed yolov5 openvino (outlayer ie::layout::NCDHW || outlayer ie::layout::NDHWC)
@linhaoqi027 thanks. I also use opset = 10 now, but I have trouble on final result after converting openvino model. I can output 3 features map from converted model and then apply some numpy calculation & nms step to output bounding bo (followed #343 ) . But its seems NMS step doesn't working. Could you share your script to inference of converted openvino model ? if possile, could you give me your contact ? Thank you in advance !!!
@anhnktp can you tell me please if you have output with 5d shape like 1x80x80x3x7 cause i have an error when i run my transformed yolov5 openvino (outlayer ie::layout::NCDHW || outlayer ie::layout::NDHWC)
I can't known the reason without debug.But u can transform output to tensor then apply nms in this project.It works.
thanks for your reply , my question was that i transformed onnx to xml format but when i try to do inference in openvino i get errors can you please tell me what wrong in my xml file
openvio(1).zip
thanks for your reply , my question was that i transformed onnx to xml format but when i try to do inference in openvino i get errors can you please tell me what wrong in my xml file
openvio(1).zip
Oh I will upload my project soon, and you can read my code directly soon. Sorry I dont have enough time to debug your code.
感谢您的答复,我的问题是我将onnx转换为xml格式,但是当我尝试在openvino中进行推断时遇到错误,您能告诉我xml文件
openvio(1).zip中有什么问题吗,
哦,我将上传我的项目很快,您可以很快直接阅读我的代码。抱歉,我没有足够的时间来调试您的代码。
you can following https://github.com/ultralytics/yolov5/issues/891 to start
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Most helpful comment
Sorry buddy, can't help, no experience. If you get this to work it might be useful to write a tutorial that we could add to https://github.com/ultralytics/yolov5#tutorials to help others.