Cannot install pytorch

I’ve downloaded the wheel of pytorch 1.6 for the nvidia platform from their github, and have been attempting to install it. The install process appears to run, but when I try to import it in python, it returns an error:

File “/usr/lib/python3.6/ctypes/init.py”, line 348, in init
self._handle = _dlopen(self._name, mode)
OSError: libmpi_cxx.so.20: cannot open shared object file: No such file or directory

When I try to run the hello-world AI tutorial, it works fine up until the part where I try to train a network on new data, at which point it says it cannot find the torch library. I’ve run all the commands specified in the tutorial. When that didn’t work, I tried downloading the wheel directly rather than using the installer.
Back when I was using the tutorial’s commands, it was returning a different error, having to do with libcudart. Using the official wheel fixed that error, and now it’s hitting the libmpi error.

This has been occurring with wheels from different sources as well. Other packages like tensorflow or numpy import fine.
I’m using the jetson nano, and am not running this inside a docker container or in a conda environment.

What am I missing? How did you guys get this working?

Hi,

It’s recommended to use l4t-pytorch and l4t-ml containers from NGC for pyTorch v1.6.

For more detail, please check this topic:

Thanks.

It looks like that did it! Thanks so much!

For others who may read this thread - you have to run this before installing the PyTorch wheel:

sudo apt-get install libopenblas-base libopenmpi-dev 

See here for more instructions: https://forums.developer.nvidia.com/t/pytorch-for-jetson-nano-version-1-6-0-now-available/

6 Likes