Hello!
When trying to convert ONNX file into TensorRT engine file on my Jetson Nano I get following error:
ERROR: builtin_op_importers.cpp:3422 In function importResize:
[8] Assertion failed: scales.is_weights() && "Resize scales must be an initializer!"
|yolov5|error|[Builder] buildEngine() failure: could not parse ONNX model from file
Detailed log of conversion is attached.
As can be seen in log, initial Pytorch model was generated using Yolo5 and converted to ONNX through: https://github.com/noahmr/yolov5-tensorrt
Environment
TensorRT Version: 8.0.1 GPU Type: Jetson Nano (Maxwell) CUDA Version: 10.2.300 CUDNN Version: 8.2.1 Operating System + Version: Ubuntu 18.04 (Jetpack 4.6) PyTorch Version (if applicable): 1.12.1
Relevant Files
Please attach or include links to any models, data, files, or scripts necessary to reproduce your issue. (Github repo, Google Drive, Dropbox, etc.)
Hi,
Request you to share the ONNX model and the script if not shared already so that we can assist you better.
Alongside you can try few things:
validating your model with the below snippet
check_model.py
import sys
import onnx
filename = yourONNXmodel
model = onnx.load(filename)
onnx.checker.check_model(model).
2) Try running your model with trtexec command.
In case you are still facing issue, request you to share the trtexec “”–verbose"" log for further debugging
Thanks!
Hello!
Link you provided seems outdated and it uses TRT7 and I use TRT8.
Nevertheless, I tried all eight possible (and impossible) Opset versions (from ver.9 till 16) and still keep getting the same error regardless the opset I try ?
The same ONNX to TRT conversion script (which I have provided above) did successful job when I got the PT model from some other Pytorch version (don’t know which it was), but why my current 1.12.1 would generate problematic model whose ONNX cannot be successfully converted to TRT ??