I have pytorch model that crops 46x146 input to multiple 32x32 region and each region is fed to classifiers.
The (simplified) model is exported as “model_dummy.onnx” .
I checked the onnx file by the visualizer and
I confirmed that the onnx “Slice” operator is used and it has expected attributes (axis, starts, ends).
When I build the model by tensorRT on Jetson Xavier,
The debug output shows that slice operator outputs 1x1 regions instead of 32x32 regions.
The build script is “trt_runner_dummy.py” and the log file is “trt_runner_dummy.py.log”.
Part of the log is :
[TensorRT] VERBOSE: 3:Slice -> (3, 46, 146)
[TensorRT] VERBOSE: 4:Slice -> (3, 46, 146)
[TensorRT] VERBOSE: 5:Slice -> (3, 1, 146)
[TensorRT] VERBOSE: 6:Slice -> (3, 1, 1)
In the project, I use CNN as classifiers. So the incorrect 1x1 shape results in broken predictions.
How Can I fix this issue?
Environment A (where Model is trained and ONNX model is exported)
TensorRT Version: None
GPU Type: RTX1080
Nvidia Driver Version: 410.48
CUDA Version: 10.0
CUDNN Version: 7
Operating System + Version: Ubuntu16.04
Python Version (if applicable): 3.5.2
TensorFlow Version (if applicable): None
PyTorch Version (if applicable): 1.0.0
Baremetal or Container (if container which image + tag): Container based on nvidia/cuda:10.0-cudnn7-devel-ubuntu16.04
pip package ONNX Version: 1.5
Environment B (where build script (using TensorRT) is run)
Jetpack Version: 4.3
Python Version (if applicable): 3.6.9
Steps To Reproduce
- tesnorrt python source is at ‘/usr/src/tensorrt/samples/python’
- “model_dummy.onnx” is in current directory