Onnx-packnet example fails

I try to reproduce the onnx-packnet example by calling the convert_to_onnx.py code and get this error

/home/bozkalayci/miniconda3/envs/tensorrt/bin/python /home/bozkalayci/workspace/python/onnx_packnet/convert_to_onnx.py
Traceback (most recent call last):
File “/home/bozkalayci/workspace/python/onnx_packnet/convert_to_onnx.py”, line 66, in
File “/home/bozkalayci/workspace/python/onnx_packnet/convert_to_onnx.py”, line 62, in main
post_process_packnet(args.output, args.opset)
File “/home/bozkalayci/workspace/python/onnx_packnet/convert_to_onnx.py”, line 21, in post_process_packnet
graph = process_pad_nodes(graph)
File “/home/bozkalayci/workspace/python/onnx_packnet/post_processing.py”, line 43, in process_pad_nodes
fold_pad_inputs(node, graph)
File “/home/bozkalayci/workspace/python/onnx_packnet/post_processing.py”, line 50, in fold_pad_inputs
pad_values_pyt = node.i(1).i(0).i(0).i(0).i(0).i(0).i(0).i(0).attrs[‘value’].values
File “/home/bozkalayci/miniconda3/envs/tensorrt/lib/python3.7/site-packages/onnx_graphsurgeon/ir/node.py”, line 62, in i
return self.inputs[tensor_idx].inputs[producer_idx]
IndexError: list index out of range


Name Version Build Channel

onnx 1.6.0 pypi_0 pypi
onnx-graphsurgeon 0.2.7 pypi_0 pypi
tensorrt pypi_0 pypi
pytorch 1.6.0 py3.7_cuda10.2.89_cudnn7.6.5_0 pytorch

TRT currently support python version 3.6. Could you please try with 3.6 version and let us know in case you are still facing issues.
Please refer below link for support matrix:


Thanks for the guide. I got the onnx by this minimal python env :)

pip list
Package Version

numpy 1.19.4
onnx 1.6.0
onnx-graphsurgeon 0.2.7
pip 20.3.1
pkg-resources 0.0.0
protobuf 3.14.0
setuptools 39.0.1
six 1.15.0
torch 1.4.0+cpu