I have an ONNX model created successfully from source algorithm, there are no errors in ONNX creation, I verified the ONNX model using ONNX checker.
Using this ONNX model I am able to create TRT engine and run inference successfully on Tesla T4, Quadro P1000 but, when I try to create the TRT engine on Jetson AGX Xavier board it fails with the error:
This error often happens when the model is generated with static input dimension but trying to use dynamic batch with trtexec.
Usually, the root cause is that the reshape size is different from the actual input size.
Could you try to generate the ONNX file with dynamic_axes and try it again?
Or since there is no issue in v7.2, you can wait for our announcement for the new release.
I generated ONNX file with dynamic_axes as well and tried converting that ONNX to TRT but the engine creation fails with the same error.
After reading some more issues in the developer forums, I replaced the reshape function with view function in my source code, but that also does not help in resolving the error.
Is there no workaround to make this ONNX model having dynamic_axes to work with Jetpack 4.5.1 which has TensorRT version 7.1.3.0?
Please update your model into float-type input format with the below comment:
After that, you will meet a reshape issue like below:
[07/27/2021-16:22:53] [E] [TRT] Reshape_78: -1 wildcard has infinite number of solutions or no solution
[07/27/2021-16:22:53] [E] [TRT] Builder failed while analyzing shapes.
The error indicates that the reshape layer use -1 which is supported with TensorRT currently.
Is it possible to replace the dimension with some pre-defined value?
You mentioned: “The error indicates that the reshape layer use -1 which is supported with TensorRT currently.”
If -1 is supported by TensorRT should I still be replacing -1 with a pre-defined value? Or did you mean something else?
Also can you please let me know when will the new JetPack version 4.6 be released? I read that JetPack 4.6 will be released by end of July 2021, it is last week of July, I don’t find the release updates anywhere else in the forums. Where can I find the release related updates?
I reflashed my Jetson AGX Xavier with JetPack4.6, it has TensorRT 8.0.16. I used the same ONNX I shared with you earlier which has dynamic_axes for running inference on the board.
I tried allocating the max workspace size in an attempt to resolve the error, but that is not resolving the error, I see the same error despite change in workspace size.
Is this an error specific to hardware or to software?
The error indicates that the reshape layer use -1 which is NOT supported with TensorRT currently.
For JetPack 4.6, do you use the same command for TensorRT 7.2?
It’s expected that a model that can work with TensorRT v7.2 should also be supported with TensorRT v8.0.
I used the same command to generate TRT engine from ONNX in Tensorrt v7.2 and v8.0
The problem seems to be with memory allocation on the Jetson Xavier board which I am not able to understand how to resolve.
Here are my observations:
I reduced the input dimensions in the optimization profiles and the TRT engine creation, inference is successful on Xavier board
Whereas, with larger input dimensions in optimization profiles I am able to generate TRT engine and do inference without any errors on Quadro P1000 GPU
Despite setting a max workspace size in the range of 10-15GB, the memory allocation issue persists on Xavier board, whereas, a few MBs of workspace size is sufficient on Quadro P1000 for engine creation
I am using the same ONNX model and same commands on all GPU platforms.
Is there something that I can change in my code on Xavier, to ensure the memory is allocated for larger inputs as well?
Why is this memory related issue so specific to Jetson AGX Xavier?