Pytorch for jetson nano orin does not work

Stefano_Garzoni: <p>I installed all the useful libraries and also CUDA (version 11.8.89), but when I install torch version: 2.0 .0+nv23.05 and torchvision version : 0.15.1<br>
following the specific instructions for installing on jetson given by nvidia (<a href="https://forums.developer.nvidia.com/t/pytorch-for-jetson/72048" rel="noopener nofollow ugc">PyTorch for Jetson</a>) and trying to test everything (python3; &gt;&gt;import torch ; &gt;&gt;torch.cuda.is_available() = true) BUT (python3; &gt;&gt;import torchvision =&gt;<br>
gives the following error which I can’t fix:<br>
Traceback (most recent call last):<br>
File “”, line 1, in<br>
File “/home/fenixtek/.local/lib/python3.8/site-packages/torchvision-0.15.1-py3.8-linux-aarch64.egg/torchvision/<strong>init</strong>.py”, line 6, in<br>
from torchvision import datasets, io, models, ops, transforms, utils<br>
File “/home/fenixtek/.local/lib/python3.8/site-packages/torchvision-0.15.1-py3.8-linux-aarch64.egg/torchvision/datasets/<strong>init</strong>.py”, line 1, in<br>
from ._optical_flow import FlyingChairs, FlyingThings3D, HD1K, KittiFlow, Sintel<br>
File “/home/fenixtek/.local/lib/python3.8/site-packages/torchvision-0.15.1-py3.8-linux-aarch64.egg/torchvision/datasets/_optical_flow.py”, line 12, in<br>
from …io.image import _read_png_16<br>
File “/home/fenixtek/.local/lib/python3.8/site-packages/torchvision-0.15.1-py3.8-linux-aarch64.egg/torchvision/io/<strong>init</strong>.py”, line 8, in<br>
from ._load_gpu_decoder import _HAS_GPU_VIDEO_DECODER<br>
File “/home/fenixtek/.local/lib/python3.8/site-packages/torchvision-0.15.1-py3.8-linux-aarch64.egg/torchvision/io/_load_gpu_decoder.py”, line 1, in<br>
from …extension import _load_library<br>
File “/home/fenixtek/.local/lib/python3.8/site-packages/torchvision-0.15.1-py3.8-linux-aarch64.egg/torchvision/extension.py”, line 107, in<br>
_check_cuda_version()<br>
File “/home/fenixtek/.local/lib/python3.8/site-packages/torchvision-0.15.1-py3.8-linux-aarch64.egg/torchvision/extension.py”, line 80, in _check_cuda_version<br>
raise RuntimeError(<br>
RuntimeError: Detected that PyTorch and torchvision were compiled with different CUDA versions. PyTorch has CUDA Version=11.4 and torchvision has CUDA Version=11.8. Please reinstall the torchvision that matches your PyTorch install.</p>
<p>and I get the same error even if I try to run my py code containing my project based on yolo</p>
<p>if I clearly follow the guide given by pytorch (<a href="https://pytorch.org/get-started/locally/" rel="noopener nofollow ugc">Start Locally | PyTorch</a>) when I then test the result I have (python3; &gt;&gt;import torch ; &gt;&gt;torch.cuda.is_available() = false) and same doing “pip3 install torch” ; “pip3 install torch==2.0.0” ; “pip3 install torchvision” ; “pip3 install torchvision==0.15.1” ; etc etc</p>
<p>so I think that to install pytorch I have to follow the appropriate nvidia guide (as above: <a href="https://forums.developer.nvidia.com/t/pytorch-for-jetson/72048" rel="noopener nofollow ugc">PyTorch for Jetson</a>), but in any case that error comes out!<br>
I don’t know if I need to modify some installation files or download other libraries, I’m desperate!<br>
if I made a trivial mistake, forgive me, I’m still a beginner despite everything.<br>
I hope someone can help me and I thank in advance anyone who can help me solve the problem!</p>
<p>(sorry, I forgot to tell you my Jetpack version : 5.1.1)</p>

ptrblck: <p>You need to build <code>torchvision</code> with the same CUDA version used in your JetPack installation (11.4) while you are trying to use a <code>torchvision</code> build with 11.8.</p>