'torchvision.version' has no attribute named 'cuda'

I have followed the Pytorch and torchvision installation steps from both the ORIN setup guide and various posts on the developer forums. The problem that I am having is getting torchvision to install with cuda on the ORIN. When I used the L4T containers provided, the torchvision installation there has the cuda attribute. I am confused as to why there is a discrepency and would like to know how to get the cuda attribute to be installed and working with torchvision. Please help.

Hi Jordan, here’s the procedure that’s done in the dockerfile to install torchvision on top of PyTorch:

You should be able to follow those same steps inside the RUN commands.

Thanks @dusty_nv! That did the trick. I did have to remove torchvision from the base environment (think this might have caused some issues) and then rebuild it in the virtual environment. When I did such, I was able to verify that torchvision indeed is the cuda version.

@dusty_nv some additional details:

Running the script in a new environment didn’t work. I dug into torchvision’s setup.py file to find a solution. I found that by including the following in the script:

export FORCE_CUDA=1
export CUDA_HOME=/usr/local/cuda-11/

We would essentially force the cuda installation of torchvision. From here the torchvision script became reproducible in newly created environments.

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