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

onnx 1.4.1 dependency #539

Closed
tnaduc opened this issue Mar 28, 2022 · 4 comments
Closed

onnx 1.4.1 dependency #539

tnaduc opened this issue Mar 28, 2022 · 4 comments

Comments

@tnaduc
Copy link

tnaduc commented Mar 28, 2022

Hi Jk,
Thank you for the tutorials. They are extremely helpful.

Could you please help to look into the onnx==1.4.1 dependency for the yolov4/yolov3 demo and shine some lights on how can we overcame this dependency to use later onnx version to potentially open up to more models.

I understand it is mentioned here:
https://forums.developer.nvidia.com/t/tensorrt-backend-for-onnx-on-jetson-nano/74980/6

@jkjung-avt
Copy link
Owner

jkjung-avt commented Mar 31, 2022

This onnx==1.4.1 requirement is due to the use of ONNX "Upsample" op to implement "upsample" layer in DarkNet models, e.g. a example "upsample" layer in the yolov4 model.

The ONNX "Upsample" op is only available in python onnx==1.4.1 (ONNX opset 9). It has been deprecated since ONNX opset 10. That's why my current code in this repo only works with onnx==1.4.1.

You could reference NVIDIA's latest TensorRT/samples/python/yolov3_onnx code for how to solve this. It has been updated to onnx==1.9.0. And it uses ONNX "Resize" op to implement DarkNet's "upsample" layer instead.

I might look into this and update the code when I have time. Otherwise, I also welcome such a pull request...

@jkjung-avt
Copy link
Owner

@tnaduc I've updated the "yolo_to_onnx.py" code. It now works for onnx==1.9.0 (but won't work for onnx==1.4.1 anymore). I've only tested it with TensorRT 8.0 so far, but I think it should work for TensorRT 7 as well.

Please give it a try.

@sachinkmohan
Copy link

@tnaduc I've updated the "yolo_to_onnx.py" code. It now works for onnx==1.9.0 (but won't work for onnx==1.4.1 anymore). I've only tested it with TensorRT 8.0 so far, but I think it should work for TensorRT 7 as well.

Please give it a try.

Awesome! Thanks! Will test this!

@tnaduc
Copy link
Author

tnaduc commented Jun 20, 2022

Thank you @jkjung-avt you are amazing.

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

3 participants