Hello,I have a jetson agx orin (version of jetpack is 5.1.2) and I’m having some problems with the environment:
I installed anaconda on orin and created a python3.8 environment. I’m in the web site Installing PyTorch for Jetson Platform - NVIDIA Docs to download the torch-2.0.0+nv23.05-cp38-cp38-linux_aarch64.whl, and installed torch2.0 in the anaconda environment. I according to the site after the tutorial (PyTorch for Jetson) to download and install the torchvision 0.15.1, but torchvision is not available after installation.
when I import torchvision,It will give me the following error:
>>>import torchvision
/home/thmos/anaconda3/envs/env1/lib/python3.8/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: '/home/thmos/anaconda3/envs/env1/lib/python3.8/site-packages/torchvision/image.so: undefined symbol: _ZN5torch3jit17parseSchemaOrNameERKSs’If you don’t plan on using image functionality from torchvision.io, you can ignore this warning. Otherwise, there might be something wrong with your environment. Did you have libjpeg or libpng installed before building torchvision from source?
I downloaded the l4t-pytorch image, but the torch and torchvision versions of the python environment are different from mine. Here’s what’s inside the image(version of image is l4t-pytorch:r35.2.1-pth2.0-py3):
Do I still need to build pytorch from source code that I don’t see anyone else doing? And I tried to do that without success, and there were a lot of other bugs.
No, you just need to build TorchVision from the source.
BUILD_VERSION should be 0.14.1.
$ sudo apt-get install libjpeg-dev zlib1g-dev libpython3-dev libopenblas-dev libavcodec-dev libavformat-dev libswscale-dev
$ git clone --branch <version> https://github.com/pytorch/vision torchvision # see below for version of torchvision to download
$ cd torchvision
$ export BUILD_VERSION=0.x.x # where 0.x.0 is the torchvision version
$ python3 setup.py install --user
Sorry, I tried this many times, both in anaconda environment and ubuntu default environment, and I successfully installed torch2.0.0+nv23.05 and torchvision0.14.1a0+5e8e2f1, but I still got an error:
/home/bigai/torchvision_0.14.1/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension:
warn(f"Failed to load image Python extension: {e}")
I even changed to another orin and it’s still the same. I have no idea what to do now.
Thanks for your help, I successfully installed torchvision. Ultimately, the problem is anaconda. I was unable to install torchvision from the source code in the conda environment. And if I had torch 2.0.0+nv23.05 installed in both conda and the default environment, neither environment would work with torchvision, meaning an error would be reported. However, if you uninstall torch in the conda environment, or install another version of torch, such as torch1.14. This will make torchvision normal in the default system environment.
In summary, it is not recommended to use the anaconda environment on top of orin.