Pytorch compatibility issues

Hi, I have a Orin NX and am really struggling to install torch and torchvision for Jetpack 5.1.1 with CUDA 11.4. I’ve installed torch 2.0.0+nv23.5 and torchvision 0.15.1 from Nvidia repositories. The issue is that these two versions have compatibility issues. What can I do?

*** Please note that this reply is generated by LLM automatically ***

I understand your struggle. Installing PyTorch and TorchVision on Jetson devices can be a bit tricky. I’ll provide you with a detailed solution.

Compatibility Issues

The versions you’ve installed, torch 2.0.0nv2.3.5 and torchvision 0.15.1, are indeed incompatible. This is because torchvision 0.15.1 is built on top of PyTorch 1.12, while torch 2.0.0nv2.3.5 is a newer version.

Solution

To resolve this issue, you have a few options:

  1. Downgrade PyTorch: You can downgrade PyTorch to a version compatible with torchvision 0.15.1. You can install PyTorch 1.12 using the following command:
pip3 install torch==1.12.1+cu113 torchvision==0.15.1

This will install PyTorch 1.12 and TorchVision 0.15.1, which should be compatible.

  1. Upgrade TorchVision: Alternatively, you can upgrade TorchVision to a version compatible with PyTorch 2.0. You can install the latest TorchVision version using the following command:
pip3 install torchvision --upgrade

This will install the latest TorchVision version, which should be compatible with PyTorch 2.0.

  1. Install from Source: If you’re comfortable building from source, you can install PyTorch and TorchVision from their respective repositories. This will allow you to install the latest versions and ensure compatibility.

Additional Tips

  • Make sure you have the correct CUDA version installed on your Jetson Orin NX. You can check the CUDA version using nvcc --version.
  • If you’re using a virtual environment, ensure that you’ve activated it before installing PyTorch and TorchVision.
  • You can verify the installation by running python -c "import torch; print(torch.__version__)" and python -c "import torchvision; print(torchvision.__version__)".

I hope this helps you resolve the compatibility issues and get PyTorch and TorchVision working on your Jetson Orin NX!

*** Please give the thumbs up if you get answers you like. Or provide feedback to help us improve the answer. ***

Hi,

Is JetPack 6 an option for you?
If yes, you can find prebuilt packages in our apt server below:

Thanks.

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