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

ModuleNotFoundError: No module named 'nvidia' #37

Closed
monocongo opened this issue Jun 13, 2019 · 4 comments
Closed

ModuleNotFoundError: No module named 'nvidia' #37

monocongo opened this issue Jun 13, 2019 · 4 comments

Comments

@monocongo
Copy link
Contributor

I have installed the retinanet package into an Anaconda environment using the command from the README:

$ pip install --no-cache-dir git+https://github.com/nvidia/retinanet-examples

I then try to export a model as an optimized FP16 TensorRT engine:

$ retinanet export  pytorch_retinanet/handgun_pytorch_retinanet_200000_iters.pth pytorch_retinanet/handgun_pytorch_retinanet_200000_iters.plan
Traceback (most recent call last):
  File "/home/james/miniconda3/envs/pytorch_retinanet/bin/retinanet", line 6, in <module>
    from retinanet.main import main
  File "/home/james/miniconda3/envs/pytorch_retinanet/lib/python3.7/site-packages/retinanet/main.py", line 10, in <module>
    from retinanet import infer, train, utils
  File "/home/james/miniconda3/envs/pytorch_retinanet/lib/python3.7/site-packages/retinanet/infer.py", line 12, in <module>
    from .dali import DaliDataIterator
  File "/home/james/miniconda3/envs/pytorch_retinanet/lib/python3.7/site-packages/retinanet/dali.py", line 8, in <module>
    from nvidia.dali import pipeline, ops, types
ModuleNotFoundError: No module named 'nvidia'

Am I correct in my assumption that there's an nvidia-dali package that I'm missing which is somehow pre-installed into the Python (Anaconda) environment of the Docker image? I ask because in the container I see this:

$ conda list | grep nvidia
nvidia-dali               0.9.1                    pypi_0    pypi

However, it doesn't appear that I can install the package from PyPI:

$ pip install nvidia-dali
Collecting nvidia-dali
  ERROR: Could not find a version that satisfies the requirement nvidia-dali (from versions: none)
ERROR: No matching distribution found for nvidia-dali

Can anyone advise? Thanks in advance...

@monocongo
Copy link
Contributor Author

After a bit of searching it appears that I can install nvidia-dali like so:

$ pip install --extra-index-url https://developer.download.nvidia.com/compute/redist/cuda/10.0 nvidia-dali

Perhaps this should be added into the README as a requirement for users like myself who aren't using the Docker container?

@pkashinkunti
Copy link
Contributor

Yes, you are correct that DALI is already installed by default in the PyTorch NGC container.

As stated near the top of the README, we strongly encourage users to leverage these containers to use this project: this allows users to pick up the latest performance optimizations baked into the monthly container releases, and it makes managing the dependencies of this project much simpler.

Of course, you are free to configure this project to work with your own setup, but do so at your own peril :) We provide links at the top of the README to each of the major SW components used by the project where users can find the appropriate installation instructions.

@azuryl
Copy link

azuryl commented Jan 21, 2020

I am also not using the Docker container, "pip install --extra-index-url https://developer.download.nvidia.com/compute/redist/cuda/10.0 nvidia-dali" is very important. I meet this problem too @pkashinkunti since Xavier need not use Xavier

@TryHard-LL
Copy link

for cuda 10.2:
pip install --extra-index-url https://developer.download.nvidia.com/compute/redist --upgrade nvidia-dali-cuda102

for cuda 11.0:
pip install --extra-index-url https://developer.download.nvidia.com/compute/redist --upgrade nvidia-dali-cuda110

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

4 participants