Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: No module named 'graphsurgeon' #33

Open
mihg opened this issue Nov 10, 2018 · 3 comments
Open

ImportError: No module named 'graphsurgeon' #33

mihg opened this issue Nov 10, 2018 · 3 comments

Comments

@mihg
Copy link

mihg commented Nov 10, 2018

my platform is TX2,
dpkg -l | grep TensorRT
ii libnvinfer-dev 4.1.3-1+cuda9.0 arm64 TensorRT development libraries and headers
ii libnvinfer-samples 4.1.3-1+cuda9.0 arm64 TensorRT samples and documentation
ii libnvinfer4 4.1.3-1+cuda9.0 arm64 TensorRT runtime libraries
ii tensorrt 4.0.2.0-1+cuda9.0 arm64 Meta package of TensorRT

when run

python scripts/convert_plan.py data/frozen_graphs/inception_v1.pb data/plans/inception_v1.plan input 224 224 InceptionV1/Logits/SpatialSqueeze 1 0 float

it shows

Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/uff/converters/tensorflow/conversion_helpers.py", line 36, in from_tensorflow
import graphsurgeon as gs
ImportError: No module named 'graphsurgeon'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "scripts/convert_plan.py", line 71, in
data_type
File "scripts/convert_plan.py", line 22, in frozenToPlan
text=False,
File "/usr/local/lib/python3.5/dist-packages/uff/converters/tensorflow/conversion_helpers.py", line 149, in from_tensorflow_frozen_model
return from_tensorflow(graphdef, output_nodes, preprocessor, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/uff/converters/tensorflow/conversion_helpers.py", line 41, in from_tensorflow
https://docs.nvidia.com/deeplearning/sdk/tensorrt-api/#python and click on the 'TensoRT Python API' link""".format(err))
ImportError: ERROR: Failed to import module (No module named 'graphsurgeon')
Please make sure you have graphsurgeon installed.
For installation instructions, see:
https://docs.nvidia.com/deeplearning/sdk/tensorrt-api/#python and click on the 'TensoRT Python API' link

so how can i fix it?

@wangyihuan123
Copy link

I guess you installed uff python package from TensorRT-4.0.2 not 3.0.4.
Please follow the instruction and try pip install TensorRT-**3.0.4/**uff/uff-0.2.0-py2.py3-none-any.whl
I had the similar issue like yours. It was fixed after I downloaded and reinstall 3.0.4 version:

sudo pip uninstall uff
sudo pip install TensorRT-3.0.4/uff/uff-0.2.0-py2.py3-none-any.whl

@mihg
Copy link
Author

mihg commented Nov 13, 2018

yes,it works.
thank you !

@Amealsuraj
Copy link

I followed this GeekAlexis/FastMOT#15
No module named 'graphsurgeon' is gone but I am getting new error
import graphsurgeon as gs
File "/usr/lib/python3.8/dist-packages/graphsurgeon/init.py", line 51, in
raise ImportError("""ERROR: Failed to import module ({})
ImportError: ERROR: Failed to import module (No module named 'tensorflow')
Please make sure you have TensorFlow installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants