Problems installing Torchvision

I have installed pytorch and torch vision using the jetson-inference tutorial script on github by dusty-nv. Pytorch has been successfully installed and tested on python 3.6. However, when I try to import torchvision python says it does not exist. I am not sure what is happening ?

[jetson-inference] Package selection status: 0
[jetson-inference] Packages selected for download: 1
[jetson-inference] Downloading PyTorch v1.6.0 (Python 3.6)…
[jetson-inference] Checking for ‘python3-pip’ deb package…installed
[jetson-inference] Checking for ‘qtbase5-dev’ deb package…installed
[jetson-inference] Checking for ‘libjpeg-dev’ deb package…installed
[jetson-inference] Checking for ‘zlib1g-dev’ deb package…installed
[jetson-inference] Checking for ‘libopenblas-base’ deb package…installed
[jetson-inference] Checking for ‘libopenmpi-dev’ deb package…installed
Requirement already satisfied: Cython in /usr/local/lib/python3.6/dist-packages (0.29.21)
WARNING: Running pip as the ‘root’ user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: 12. Virtual Environments and Packages — Python 3.12.0 documentation
Using pip 21.3.1 from /usr/local/lib/python3.6/dist-packages/pip (python 3.6)
Requirement already satisfied: numpy in /usr/local/lib/python3.6/dist-packages (1.19.5)
WARNING: Running pip as the ‘root’ user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: 12. Virtual Environments and Packages — Python 3.12.0 documentation
torch-1.6.0-cp36-cp36m-linux_aarch64.whl 100%[===================================================================================================================================>] 256.58M 3.11MB/s in 84s
Processing ./torch-1.6.0-cp36-cp36m-linux_aarch64.whl
Requirement already satisfied: future in /usr/local/lib/python3.6/dist-packages (from torch==1.6.0) (0.18.2)
Requirement already satisfied: numpy in /usr/local/lib/python3.6/dist-packages (from torch==1.6.0) (1.19.5)
torch is already installed with the same version as the provided wheel. Use --force-reinstall to force an installation of the wheel.
WARNING: Running pip as the ‘root’ user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: 12. Virtual Environments and Packages — Python 3.12.0 documentation
[jetson-inference] temporarily moving /usr/bin/ffmpeg → /usr/bin/ffmpeg_bak
[jetson-inference] cloning torchvision…
Cloning into ‘torchvision-36’…
remote: Enumerating objects: 153215, done.
remote: Counting objects: 100% (5588/5588), done.
remote: Compressing objects: 100% (534/534), done.
remote: Total 153215 (delta 5089), reused 5470 (delta 5031), pack-reused 147627
Receiving objects: 100% (153215/153215), 299.83 MiB | 2.73 MiB/s, done.
Resolving deltas: 100% (135682/135682), done.
Note: checking out ‘78ed10cc51067f1a6bac9352831ef37a3f842784’.

You are in ‘detached HEAD’ state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

git checkout -b

[jetson-inference] building torchvision for Python 3.6…
./install-pytorch.sh: line 534: 9051 Illegal instruction sudo python3 setup.py install
[jetson-inference] restoring /usr/bin/ffmpeg from /usr/bin/ffmpeg_bak

[jetson-inference] installation complete, exiting with status code 0
[jetson-inference] to run this tool again, use the following commands:

$ cd <jetson-inference>/build
$ ./install-pytorch.sh

dhirendra@jetson2:~/jetson-inference/build$ python3
Python 3.6.9 (default, Mar 15 2022, 13:55:28)
[GCC 8.4.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.

import torchvision
Traceback (most recent call last):
File “”, line 1, in
ModuleNotFoundError: No module named ‘torchvision’

It appears that there was some system error when the script tried building/installing torchvision. I’m not exactly sure what would cause ‘illegal instruction’, but can you try running the following and see if this also produces an error?

$ python3 -c 'import numpy'

If so, you can try this fix or upgrading numpy. And if you continue having issues with it, you may want to try the l4t-pytorch container which comes with PyTorch and torchvision pre-installed.

It did not work, I have the same issue. The problem was that the kernell was blocked from updates by the person installing jetpack.

Thanks for your time

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