Unable to install Torchvision 0.10.0 on Jetson Nano

I would like to install Pytorch and Torchvision on my Jetson Nano 2GB developer kit. I installed Pytorch version 1.9.0 successfully, but I could not install Torchvision. I had referred many procedures but installation is still in vain. I follow the instruction here.

Terminal message:

/home/vcc_jetson1/torchvision/torchvision/csrc/ops/autograd/deform_conv2d_kernel.cpp: In static member function ‘static torch::autograd::variable_list vision::ops::{anonymous}::DeformConv2dFunction::forward(torch::autograd::AutogradContext*, const Variable&, const Variable&, const Variable&, const Variable&, const Variable&, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, bool)’:
/home/vcc_jetson1/torchvision/torchvision/csrc/ops/autograd/deform_conv2d_kernel.cpp:30:9: error: AutoDispatchBelowADInplaceOrView’ is not a member of ‘at’
     at::AutoDispatchBelowADInplaceOrView g;
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/vcc_jetson1/torchvision/torchvision/csrc/ops/autograd/deform_conv2d_kernel.cpp: In static member function ‘static torch::autograd::variable_list vision::ops::{anonymous}::DeformConv2dBackwardFunction::forward(torch::autograd::AutogradContext*, const Variable&, const Variable&, const Variable&, const Variable&, const Variable&, const Variable&, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, int64_t, bool)’:
/home/vcc_jetson1/torchvision/torchvision/csrc/ops/autograd/deform_conv2d_kernel.cpp:145:9: error: AutoDispatchBelowADInplaceOrView’ is not a member of ‘at’
     at::AutoDispatchBelowADInplaceOrView g;
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/vcc_jetson1/.local/lib/python3.6/site-packages/torch/include/torch/csrc/api/include/torch/autograd.h:4:0,
                 from /home/vcc_jetson1/torchvision/torchvision/csrc/ops/autograd/deform_conv2d_kernel.cpp:3:
/home/vcc_jetson1/.local/lib/python3.6/site-packages/torch/include/torch/csrc/autograd/custom_function.h: In instantiation of ‘torch::autograd::variable_list torch::autograd::CppNode<T>::apply(torch::autograd::variable_list&&) [with T = vision::ops::{anonymous}::DeformConv2dBackwardFunction; torch::autograd::variable_list = std::vector<at::Tensor>]’:
/home/vcc_jetson1/torchvision/torchvision/csrc/ops/autograd/deform_conv2d_kernel.cpp:266:1:   required from here
/home/vcc_jetson1/.local/lib/python3.6/site-packages/torch/include/torch/csrc/autograd/custom_function.h:279:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (num_outputs > num_forward_inputs) {
       ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/home/vcc_jetson1/.local/lib/python3.6/site-packages/torch/include/torch/csrc/autograd/custom_function.h:290:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (num_outputs != num_forward_inputs) {
       ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
/home/vcc_jetson1/.local/lib/python3.6/site-packages/torch/include/torch/csrc/autograd/custom_function.h:300:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i = 0; i < num_outputs; ++i) {
                   ~~^~~~~~~~~~~~~
/home/vcc_jetson1/.local/lib/python3.6/site-packages/torch/include/torch/csrc/autograd/custom_function.h: In instantiation of ‘torch::autograd::variable_list torch::autograd::CppNode<T>::apply(torch::autograd::variable_list&&) [with T = vision::ops::{anonymous}::DeformConv2dFunction; torch::autograd::variable_list = std::vector<at::Tensor>]’:
/home/vcc_jetson1/torchvision/torchvision/csrc/ops/autograd/deform_conv2d_kernel.cpp:266:1:   required from here
/home/vcc_jetson1/.local/lib/python3.6/site-packages/torch/include/torch/csrc/autograd/custom_function.h:279:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (num_outputs > num_forward_inputs) {
       ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
/home/vcc_jetson1/.local/lib/python3.6/site-packages/torch/include/torch/csrc/autograd/custom_function.h:290:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   if (num_outputs != num_forward_inputs) {
       ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
/home/vcc_jetson1/.local/lib/python3.6/site-packages/torch/include/torch/csrc/autograd/custom_function.h:300:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i = 0; i < num_outputs; ++i) {
                   ~~^~~~~~~~~~~~~
error: command 'aarch64-linux-gnu-gcc' failed with exit status 1

Hi,

Would you mind sharing your environment with us?

We test TorchVision v0.10.0 on JetPack 4.6.1 with nvcr.io/nvidia/l4t-pytorch:r32.7.1-pth1.9-py3 container.
It can be compiled without error.

Below are our steps for your reference:

$ sudo docker run -it --rm --runtime nvidia --network host nvcr.io/nvidia/l4t-pytorch:r32.7.1-pth1.9-py3
$ git clone --branch v0.10.0 https://github.com/pytorch/vision torchvision
$ cd torchvision/
$ export BUILD_VERSION=0.10.0
$ python3 setup.py install --user
...
Using /usr/local/lib/python3.6/dist-packages
Searching for dataclasses==0.8
Best match: dataclasses 0.8
Adding dataclasses 0.8 to easy-install.pth file

Using /usr/local/lib/python3.6/dist-packages
Finished processing dependencies for torchvision==0.10.0

Thanks.

I’m using a Jetson Nano 4gb but this should work for 2gb too.

I was able to install Pytorch and Torchvision using this guide:
Pytorch is at the top of the HowTo, go further down to find Torchvision

Thank you very much! I try your installation guide and it’s worked.

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