Closed NoLoPhe closed 2 years ago
I used the Picodet model you released, but still got the same error.
I have tested and sure onnx_tensorrt.backend has no problem, I have tested the model yolox onnx
This is a TensorRT problem.
Assertion failed: (mode != "nearest" || nearest_mode == "floor") && "This version of TensorRT only supports floor nearest_mode!" https://forums.developer.nvidia.com/t/centernet-mobilenet-v2-from-tfod-failure-when-converting-onnx-to-trt/183972/6
Thank you for your immediate reply!
TensorRT 8.2. It works normally. I've known for a while that the old TensorRT had that problem. So I recently updated all my environments to TensorRT 8.2.
>>> import onnx
>>> import onnx_tensorrt.backend as backend
>>> import numpy as np
>>> import time
>>> model = onnx.load("picodet_s_320x320.onnx")
>>> engine = backend.prepare(model, device='CUDA:0')
[11/16/2021-11:44:38] [TRT] [W] onnx2trt_utils.cpp:366: Your ONNX model has been generated with INT64 weights, while TensorRT does not natively support INT64. Attempting to cast down to INT32.
>>> input_data = np.ones((1,3,320,320)).astype(np.float32)
>>> output_data = engine.run(input_data)[0]
>>> print(output_data)
[[[0.00368589 0.00156462 0.00319499 ... 0.00099653 0.00055185 0.00061941]
[0.00282133 0.00119847 0.00223592 ... 0.00065058 0.00027722 0.00038844]
[0.00267431 0.00134867 0.00246176 ... 0.00068846 0.00026196 0.00044441]
...
[0.00795203 0.00173521 0.00448856 ... 0.00186968 0.00104919 0.00120309]
[0.00829846 0.00194225 0.00480601 ... 0.00202399 0.001185 0.00131527]
[0.00815716 0.0022305 0.00516585 ... 0.00217304 0.00137123 0.00165436]]]
Installing onnx_tensorrt on Xavier NX is very difficult, I went around from jetpack 4.5 -> 4.6 -> 4.4 -> 4.5. In jetpack 4.6 tensorRT 8.0.1.6 requires library onnx=1.8.0, can only install onnx=1.6.0 (if anyone reading this is on jetpack 4.6, I would love to ask them to install onnx=1.8. 1, is it possible?), besides scipy is also very difficult to install. In jetpack 4.4 version, I often encounter minor errors, unstable operation, or freeze when running the model. I am very satisfied with jetpack 4.5.1.
Following your suggestion on the Nvidia forum the more modern tensorflow code, I hope can solve this problem. Can you help me convert by another pipeline Padlepadle -> TF -> onnx.
I suddenly came up with an idea like that, I don't know if it's possible.
See. https://github.com/PINTO0309/PINTO_model_zoo/issues/150
If the accuracy deteriorates, there is nothing you can do about it.
Once again many thanks for your help!
I use two computers *the first computer only runs on CPU I used CPU to Convert to ONNX Paddle2ONNX= 0.8.2 and ONNX 1.9.0 onnx-simplifier = 0.3.6
I run:
I don't get any error
*second computer is xavier NX, when I run ONNX on xavier NX use onnx_tensorrt.backend ONNX 1.8.1 tensorRT 7.1.3 jetpack 4.5.1
I run:
I got an error