Issues installing PyTorch on Jetson Nano running JetPack 4.2

I’m currently working through the Hello AI World Transfer Learning with PyTorch section and I am having issues installing PyTorch. I have used the automatic installer included as part of the jetson-inference repository and it appears to work correctly however, when I try to verify the installation, as suggested in the guide, by trying to import the torch and torchvision modules in Python I receive errors stating that the modules cannot be found. I have subsequently tried to import the modules manually using pip and I receive the following error:

xxxx@xxxxxxxx:~$ pip install torch
Collecting torch
Using cached https://files.pythonhosted.org/packages/f8/02/880b468bd382dc79896eaecbeb8ce95e9c4b99a24902874a2cef0b562cea/torch-0.1.2.post2.tar.gz
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info/torch.egg-info
writing requirements to pip-egg-info/torch.egg-info/requires.txt
writing pip-egg-info/torch.egg-info/PKG-INFO
writing top-level names to pip-egg-info/torch.egg-info/top_level.txt
writing dependency_links to pip-egg-info/torch.egg-info/dependency_links.txt
writing manifest file ‘pip-egg-info/torch.egg-info/SOURCES.txt’
error: package directory ‘torch/cuda’ does not exist

----------------------------------------

Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-build-Fv1UbD/torch/

Does anyone have a solution?

Hi @boss1944,

Would you like to try my way? Here
As the Jetson deivce is ARM architecture, so sometimes the installing way is a little bit different with PC.

1 Like

Hi Chieh,

Thanks for the reply. I actually managed to resolve this issue myself, I traced the problem to a glitch with the Jetpack image after experiencing various other issues. I reformatted the SD card, flashed the Jetpack image and then rebuilt the jetson-inference project again and all the issues were resolved.

Hi @boss1944,

Got it! I am glad that you resolved it!