ModuleNotFoundError: No module named 'onnx_graphsurgeon'

Hi all, I trying to execute on the jetson nano board the program convert_to_onnx.py from the directory /usr/src/tensorrt/samples/python/onnx_packnet
But it throws error as
ModuleNotFoundError: No module named ‘onnx_graphsurgeon’
Let me know what could be the reason and solution for it.
Here is the details of the command execution and its output

/usr/src/tensorrt/samples/python/onnx_packnet$ python3.6 convert_to_onnx.py --output model.onnx
Traceback (most recent call last):
File “convert_to_onnx.py”, line 22, in
import onnx_graphsurgeon as gs
ModuleNotFoundError: No module named ‘onnx_graphsurgeon’

Thanks and Regards

Nagaraj Trivedi

Hi,

ONNX GraphSurgeon is included in our OSS GitHub.
Please follow the instructions below to build it from the source:

Thanks.

Hi, thank you for your suggestion. I have followed the procedure, but still got error.
The first step given in the link was
python3 -m pip install onnx_graphsurgeon --index-url https://pypi.ngc.nvidia.com
It got executed successfully
and the next command was
make install
make: *** No rule to make target ‘install’. Stop.

Thanks and Regards

Nagaraj Trivedi

Hi,

It should be:

$ make build
$ cd ../
$ python3 -m pip install onnx_graphsurgeon/dist/onnx_graphsurgeon-*-py2.py3-none-any.whl

Thanks.

Hi, I tried executed make build but it gave error as
~$ make build
make: *** No rule to make target ‘build’. Stop.

Let me know in which directory I need to run this command. Before this do I need to run some other commands?
I ran these commands in sequence

  1. python3 -m pip install onnx_graphsurgeon --index-url https://pypi.ngc.nvidia.com
  2. make build

Let me what other commands I need to run before make build

Thanks and Regards

N.M.Trivedi

Hi,

We have verified the steps and it works.
Please try it again:

$ git clone -b release/8.5 https://github.com/NVIDIA/TensorRT.git
$ cd TensorRT/tools/onnx-graphsurgeon/
$ make build
$ cd ../
$ sudo python3 -m pip install ./onnx-graphsurgeon/dist/onnx_graphsurgeon-0.3.26-py2.py3-none-any.whl
...
Successfully installed onnx-1.14.1 onnx-graphsurgeon-0.3.26

Thanks.

Hi, it worked. Thanks for your help.

Thanks and Regards

Nagaraj Trivedi

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.