Pytorch AND TORCHVISION on AGX Orin

I was able to successfully install PyTorch v2.1.0 (Jetpack 5) for my AGX Orin with CUDA 11.4 from here. torch.cuda.is_available() returns true. However, I also need torchvision.

If I simply download torchvision from here, and when I run my code, it says the versions don’t match. I believe this might be due to a compatibility issue.

Can someone help me in finding and installing the correct version of torchvision?

Would greatly appreciate quick reply.

Hi @aif2023, you need to either build torchvision from source (as per the steps under the Installation section of PyTorch for Jetson) or use l4t-pytorch container which already includes PyTorch, torchvision, and torchaudio pre-installed (with CUDA enabled).

And if you have trouble compiling and don’t want to use container, you can copy the pre-compiled PyTorch and torchvision wheels out of l4t-pytorch container and install them natively on your device (the built wheels are found under /opt inside container)

Thank you very much for your quick reply!

I didn’t realize that the Installation section had instructions to install torchvision, so it makes it much easier now.

I am used to running containers on my AGX Orin, but I would like to know how to install the pre-compiled PyTorch and torchvision wheels. I am not sure where you mean by ’ /opt inside container.’ Could you please help me find that?

If you run the l4t-pytorch container and navigate to /opt inside the container, you will find the wheels there. You can then copy them to a mounted volume outside of the container.

1 Like

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