I’m following Hello AI world and start the transfer learning with Pytorch.
Jetson nano is able to retrain the model with my own datset and covert it to ONNX. However, when I try to run the model I encounted a problem. It shows the ONNX model can not be parsed.
So my question is, how to fix the error?
BTW, pytorch is 1.1.0 and torchvision is 0.3.0.
following is the error message in terminal.
[TRT] 185:Conv -> (512, 7, 7)
[TRT] 186:BatchNormalization -> (512, 7, 7)
[TRT] 187:Add -> (512, 7, 7)
[TRT] 188:Relu -> (512, 7, 7)
[TRT] 189:GlobalAveragePool -> (512, 1, 1)
[TRT] 190:Constant ->
[TRT] 191:Shape -> (4)
WARNING: Your ONNX model has been generated with INT64 weights, while TensorRT does not natively support INT64. Attempting to cast down to INT32.
Successfully casted down to INT32.
While parsing node number 69 [Gather]:
ERROR: onnx2trt_utils.hpp:277 In function convert_axis:
 Assertion failed: axis >= 0 && axis < nbDims
[TRT] failed to parse ONNX model ‘test_3/resnet18.onnx’
[TRT] device GPU, failed to load test_3/resnet18.onnx
[TRT] failed to load test_3/resnet18.onnx
[TRT] imageNet – failed to initialize.
jetson.inference – imageNet failed to load built-in network ‘googlenet’
Traceback (most recent call last):
File “/usr/local/bin/imagenet-camera.py”, line 47, in
net = jetson.inference.imageNet(opt.network, sys.argv)
Exception: jetson.inference – imageNet failed to load network