Install torchvision for c++ on Jetson Nano

I want to use torchvision c++ on my Jetson Nano (Jetpack 4.5).

I need only torchvision::ops::nms function from torchvision. If you can give source codes of that function or an alternative implementation of that function with torch (c++) please share, and installation will not be required any more.

I have tried MANY ways to install, but haven’t succeed yet.

For example I tried How to set up OpenCV, LibTorch, and Torchvision with Cmake for Mac - this approach, but getting this error while running make and can’t solve it.

[  2%] Building CXX object CMakeFiles/torchvision.dir/torchvision/csrc/io/image/cpu/common_jpeg.cpp.o
[  5%] Building CXX object CMakeFiles/torchvision.dir/torchvision/csrc/io/image/cpu/decode_image.cpp.o
In file included from /usr/include/c++/7/bits/stl_algobase.h:59:0,
                 from /usr/include/c++/7/memory:62,
                 from /home/jets/Desktop/project/torch/include/c10/core/Allocator.h:4,
                 from /home/jets/Desktop/project/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/aarch64-linux-gnu/c++/7/bits/c++config.h:250:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
/usr/include/aarch64-linux-gnu/c++/7/bits/c++config.h:438:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
In file included from /usr/include/c++/7/bits/stl_algobase.h:59:0,
                 from /usr/include/c++/7/memory:62,
                 from /home/jets/Desktop/project/torch/include/c10/core/Allocator.h:4,
                 from /home/jets/Desktop/project/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/aarch64-linux-gnu/c++/7/bits/c++config.h:563:3: error: operator '&&' has no right operand
   && _GLIBCXX_USE_DUAL_ABI && __cpp_transactional_memory >= 201505L \
   ^~
In file included from /usr/include/c++/7/bits/stl_algobase.h:66:0,
                 from /usr/include/c++/7/memory:62,
                 from /home/jets/Desktop/project/torch/include/c10/core/Allocator.h:4,
                 from /home/jets/Desktop/project/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/7/bits/stl_iterator_base_funcs.h:107:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
In file included from /usr/include/c++/7/string:52:0,
                 from /usr/include/c++/7/stdexcept:39,
                 from /usr/include/c++/7/array:39,
                 from /usr/include/c++/7/tuple:39,
                 from /usr/include/c++/7/bits/unique_ptr.h:37,
                 from /usr/include/c++/7/memory:80,
                 from /home/jets/Desktop/project/torch/include/c10/core/Allocator.h:4,
                 from /home/jets/Desktop/project/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/7/bits/basic_string.h:56:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
In file included from /usr/include/c++/7/string:53:0,
                 from /usr/include/c++/7/stdexcept:39,
                 from /usr/include/c++/7/array:39,
                 from /usr/include/c++/7/tuple:39,
                 from /usr/include/c++/7/bits/unique_ptr.h:37,
                 from /usr/include/c++/7/memory:80,
                 from /home/jets/Desktop/project/torch/include/c10/core/Allocator.h:4,
                 from /home/jets/Desktop/project/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/7/bits/basic_string.tcc:50:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
In file included from /usr/include/c++/7/array:39:0,
                 from /usr/include/c++/7/tuple:39,
                 from /usr/include/c++/7/bits/unique_ptr.h:37,
                 from /usr/include/c++/7/memory:80,
                 from /home/jets/Desktop/project/torch/include/c10/core/Allocator.h:4,
                 from /home/jets/Desktop/project/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/7/stdexcept:46:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
/usr/include/c++/7/stdexcept:127:28: error: operator '||' has no left operand
 #if _GLIBCXX_USE_CXX11_ABI || _GLIBCXX_DEFINE_STDEXCEPT_COPY_OPS
                            ^~
/usr/include/c++/7/stdexcept:211:28: error: operator '||' has no left operand
 #if _GLIBCXX_USE_CXX11_ABI || _GLIBCXX_DEFINE_STDEXCEPT_COPY_OPS
                            ^~
In file included from /usr/include/c++/7/bits/ios_base.h:41:0,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /home/jets/Desktop/project/torch/include/c10/macros/Macros.h:228,
                 from /home/jets/Desktop/project/torch/include/c10/core/DeviceType.h:8,
                 from /home/jets/Desktop/project/torch/include/c10/core/Device.h:3,
                 from /home/jets/Desktop/project/torch/include/c10/core/Allocator.h:6,
                 from /home/jets/Desktop/project/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/7/bits/locale_classes.h:354:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
In file included from /usr/include/c++/7/bits/ios_base.h:46:0,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /home/jets/Desktop/project/torch/include/c10/macros/Macros.h:228,
                 from /home/jets/Desktop/project/torch/include/c10/core/DeviceType.h:8,
                 from /home/jets/Desktop/project/torch/include/c10/core/Device.h:3,
                 from /home/jets/Desktop/project/torch/include/c10/core/Allocator.h:6,
                 from /home/jets/Desktop/project/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/7/system_error:91:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
In file included from /usr/include/c++/7/ios:42:0,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /home/jets/Desktop/project/torch/include/c10/macros/Macros.h:228,
                 from /home/jets/Desktop/project/torch/include/c10/core/DeviceType.h:8,
                 from /home/jets/Desktop/project/torch/include/c10/core/Device.h:3,
                 from /home/jets/Desktop/project/torch/include/c10/core/Allocator.h:6,
                 from /home/jets/Desktop/project/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/7/bits/ios_base.h:230:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
/usr/include/c++/7/bits/ios_base.h:254:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
In file included from /home/jets/Desktop/project/torch/include/c10/macros/Macros.h:228:0,
                 from /home/jets/Desktop/project/torch/include/c10/core/DeviceType.h:8,
                 from /home/jets/Desktop/project/torch/include/c10/core/Device.h:3,
                 from /home/jets/Desktop/project/torch/include/c10/core/Allocator.h:6,
                 from /home/jets/Desktop/project/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/7/sstream:297:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
In file included from /usr/include/c++/7/sstream:826:0,
                 from /home/jets/Desktop/project/torch/include/c10/macros/Macros.h:228,
                 from /home/jets/Desktop/project/torch/include/c10/core/DeviceType.h:8,
                 from /home/jets/Desktop/project/torch/include/c10/core/Device.h:3,
                 from /home/jets/Desktop/project/torch/include/c10/core/Allocator.h:6,
                 from /home/jets/Desktop/project/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/7/bits/sstream.tcc:92:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
In file included from /usr/include/c++/7/locale:41:0,
                 from /usr/include/c++/7/iomanip:43,
                 from /home/jets/Desktop/project/torch/include/c10/util/logging_is_not_google_glog.h:8,
                 from /home/jets/Desktop/project/torch/include/c10/util/Logging.h:28,
                 from /home/jets/Desktop/project/torch/include/c10/core/TensorImpl.h:19,
                 from /home/jets/Desktop/project/torch/include/ATen/core/TensorBody.h:14,
                 from /home/jets/Desktop/project/torch/include/ATen/Tensor.h:3,
                 from /home/jets/Desktop/project/torch/include/ATen/Context.h:4,
                 from /home/jets/Desktop/project/torch/include/ATen/ATen.h:9,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/7/bits/locale_facets_nonio.h:719:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
/usr/include/c++/7/bits/locale_facets_nonio.h:1567:33: error: operator '&&' has no right operand
       && _GLIBCXX_USE_CXX11_ABI == 0
                                 ^~
/usr/include/c++/7/bits/locale_facets_nonio.h:1590:33: error: operator '&&' has no right operand
       && _GLIBCXX_USE_CXX11_ABI == 0
                                 ^~
/usr/include/c++/7/bits/locale_facets_nonio.h:1712:33: error: operator '&&' has no right operand
       && _GLIBCXX_USE_CXX11_ABI == 0
                                 ^~
/usr/include/c++/7/bits/locale_facets_nonio.h:1747:33: error: operator '&&' has no right operand
       && _GLIBCXX_USE_CXX11_ABI == 0
                                 ^~
In file included from /usr/include/c++/7/bits/locale_facets_nonio.h:2013:0,
                 from /usr/include/c++/7/locale:41,
                 from /usr/include/c++/7/iomanip:43,
                 from /home/jets/Desktop/project/torch/include/c10/util/logging_is_not_google_glog.h:8,
                 from /home/jets/Desktop/project/torch/include/c10/util/Logging.h:28,
                 from /home/jets/Desktop/project/torch/include/c10/core/TensorImpl.h:19,
                 from /home/jets/Desktop/project/torch/include/ATen/core/TensorBody.h:14,
                 from /home/jets/Desktop/project/torch/include/ATen/Tensor.h:3,
                 from /home/jets/Desktop/project/torch/include/ATen/Context.h:4,
                 from /home/jets/Desktop/project/torch/include/ATen/ATen.h:9,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/7/bits/locale_facets_nonio.tcc:352:33: error: operator '&&' has no right operand
       && _GLIBCXX_USE_CXX11_ABI == 0
                                 ^~
/usr/include/c++/7/bits/locale_facets_nonio.tcc:564:33: error: operator '&&' has no right operand
       && _GLIBCXX_USE_CXX11_ABI == 0
                                 ^~
In file included from /usr/include/c++/7/list:63:0,
                 from /home/jets/Desktop/project/torch/include/ATen/core/dispatch/OperatorEntry.h:17,
                 from /home/jets/Desktop/project/torch/include/ATen/core/dispatch/Dispatcher.h:6,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/jit/runtime/operator.h:6,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/jit/ir/ir.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/jit/api/function_impl.h:4,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/jit/api/method.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/jit/api/object.h:6,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/jit/frontend/tracer.h:9,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/autograd/generated/variable_factories.h:12,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:7,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/7/bits/stl_list.h:326:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
/usr/include/c++/7/bits/stl_list.h:349:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
/usr/include/c++/7/bits/stl_list.h:1886:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
/usr/include/c++/7/bits/stl_list.h:1955:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
In file included from /usr/include/c++/7/list:64:0,
                 from /home/jets/Desktop/project/torch/include/ATen/core/dispatch/OperatorEntry.h:17,
                 from /home/jets/Desktop/project/torch/include/ATen/core/dispatch/Dispatcher.h:6,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/jit/runtime/operator.h:6,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/jit/ir/ir.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/jit/api/function_impl.h:4,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/jit/api/method.h:7,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/jit/api/object.h:6,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/jit/frontend/tracer.h:9,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/autograd/generated/variable_factories.h:12,
                 from /home/jets/Desktop/project/torch/include/torch/csrc/api/include/torch/types.h:7,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/project/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/7/bits/list.tcc:178:27: error: #if with no expression
 #if _GLIBCXX_USE_CXX11_ABI
                           ^
CMakeFiles/torchvision.dir/build.make:89: recipe for target 'CMakeFiles/torchvision.dir/torchvision/csrc/io/image/cpu/decode_image.cpp.o' failed
make[2]: *** [CMakeFiles/torchvision.dir/torchvision/csrc/io/image/cpu/decode_image.cpp.o] Error 1
CMakeFiles/Makefile2:82: recipe for target 'CMakeFiles/torchvision.dir/all' failed
make[1]: *** [CMakeFiles/torchvision.dir/all] Error 2
Makefile:135: recipe for target 'all' failed
make: *** [all] Error 2

Changed the compiler, tried multiple other things but still cant fix this.

Tried to install torchvision for python and link libs in cmake (worked for libtorch installation), but there is no “include” or “libs” directories in torchvision directory.

Tried to install with this instructions, but when I’m running sudo -H pip3 install torchvision-0.11.0a0+fa347eb-cp36-cp36m-linux_aarch64.whl it says “No module named Cython”, but I have cython installed, then it tries to build numpy from source and again fails (I have numpy installed).

And that’s not all, tried millions of other ways but still stuck (even googled in Chinese).

Please, if you know something that can help, please say.

The current issue:

error: #if with no expression

is most likely raised by a GCC version which is too old. Could you try to use GCC 9 and check if this error disappears?

I just installed gcc-9 and g++ -9 (9.4) but the error is the same.

Consolidate compiler generated dependencies of target torchvision
[  2%] Building CXX object CMakeFiles/torchvision.dir/torchvision/csrc/io/image/cpu/decode_image.cpp.o
In file included from /usr/include/c++/9/bits/stl_algobase.h:59,
                 from /usr/include/c++/9/memory:62,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/c10/core/Allocator.h:4,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/ALPR_Cpp/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/ALPR_Cpp/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/aarch64-linux-gnu/c++/9/bits/c++config.h:277:27: error: #if with no expression
  277 | #if _GLIBCXX_USE_CXX11_ABI
      |                           ^
/usr/include/aarch64-linux-gnu/c++/9/bits/c++config.h:433:27: error: #if with no expression
  433 | #if _GLIBCXX_USE_CXX11_ABI
      |                           ^
In file included from /usr/include/c++/9/bits/stl_algobase.h:59,
                 from /usr/include/c++/9/memory:62,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/c10/core/Allocator.h:4,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/ALPR_Cpp/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/ALPR_Cpp/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/aarch64-linux-gnu/c++/9/bits/c++config.h:558:3: error: operator '&&' has no right operand
  558 |   && _GLIBCXX_USE_DUAL_ABI && __cpp_transactional_memory >= 201500L \
      |   ^~
In file included from /usr/include/c++/9/bits/stl_algobase.h:66,
                 from /usr/include/c++/9/memory:62,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/c10/core/Allocator.h:4,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/ALPR_Cpp/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/ALPR_Cpp/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/9/bits/stl_iterator_base_funcs.h:107:27: error: #if with no expression
  107 | #if _GLIBCXX_USE_CXX11_ABI
      |                           ^
In file included from /usr/include/c++/9/string:55,
                 from /usr/include/c++/9/stdexcept:39,
                 from /usr/include/c++/9/array:39,
                 from /usr/include/c++/9/tuple:39,
                 from /usr/include/c++/9/bits/unique_ptr.h:37,
                 from /usr/include/c++/9/memory:80,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/c10/core/Allocator.h:4,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/ALPR_Cpp/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/ALPR_Cpp/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/9/bits/basic_string.h:60:27: error: #if with no expression
   60 | #if _GLIBCXX_USE_CXX11_ABI
      |                           ^
In file included from /usr/include/c++/9/string:56,
                 from /usr/include/c++/9/stdexcept:39,
                 from /usr/include/c++/9/array:39,
                 from /usr/include/c++/9/tuple:39,
                 from /usr/include/c++/9/bits/unique_ptr.h:37,
                 from /usr/include/c++/9/memory:80,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/c10/core/Allocator.h:4,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/ALPR_Cpp/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/ALPR_Cpp/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/9/bits/basic_string.tcc:50:27: error: #if with no expression
   50 | #if _GLIBCXX_USE_CXX11_ABI
      |                           ^
In file included from /usr/include/c++/9/stdexcept:39,
                 from /usr/include/c++/9/array:39,
                 from /usr/include/c++/9/tuple:39,
                 from /usr/include/c++/9/bits/unique_ptr.h:37,
                 from /usr/include/c++/9/memory:80,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/c10/core/Allocator.h:4,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/ALPR_Cpp/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/ALPR_Cpp/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/9/string:58:53: error: operator '&&' has no right operand
   58 | #if __cplusplus >= 201703L && _GLIBCXX_USE_CXX11_ABI
      |                                                     ^
In file included from /usr/include/c++/9/array:39,
                 from /usr/include/c++/9/tuple:39,
                 from /usr/include/c++/9/bits/unique_ptr.h:37,
                 from /usr/include/c++/9/memory:80,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/c10/core/Allocator.h:4,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/ALPR_Cpp/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/ALPR_Cpp/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/9/stdexcept:46:27: error: #if with no expression
   46 | #if _GLIBCXX_USE_CXX11_ABI
      |                           ^
/usr/include/c++/9/stdexcept:130:28: error: operator '||' has no left operand
  130 | #if _GLIBCXX_USE_CXX11_ABI || _GLIBCXX_DEFINE_STDEXCEPT_COPY_OPS
      |                            ^~
/usr/include/c++/9/stdexcept:236:28: error: operator '||' has no left operand
  236 | #if _GLIBCXX_USE_CXX11_ABI || _GLIBCXX_DEFINE_STDEXCEPT_COPY_OPS
      |                            ^~
In file included from /usr/include/c++/9/bits/ios_base.h:41,
                 from /usr/include/c++/9/ios:42,
                 from /usr/include/c++/9/istream:38,
                 from /usr/include/c++/9/sstream:38,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/c10/macros/Macros.h:228,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/c10/core/DeviceType.h:8,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/c10/core/Device.h:3,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/c10/core/Allocator.h:6,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/ALPR_Cpp/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/ALPR_Cpp/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/9/bits/locale_classes.h:354:27: error: #if with no expression
  354 | #if _GLIBCXX_USE_CXX11_ABI
      |                           ^
In file included from /usr/include/c++/9/bits/ios_base.h:46,
                 from /usr/include/c++/9/ios:42,
                 from /usr/include/c++/9/istream:38,
                 from /usr/include/c++/9/sstream:38,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/c10/macros/Macros.h:228,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/c10/core/DeviceType.h:8,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/c10/core/Device.h:3,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/c10/core/Allocator.h:6,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/ALPR_Cpp/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/ALPR_Cpp/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/9/system_error:91:27: error: #if with no expression
   91 | #if _GLIBCXX_USE_CXX11_ABI
      |                           ^
In file included from /usr/include/c++/9/ios:42,
                 from /usr/include/c++/9/istream:38,
                 from /usr/include/c++/9/sstream:38,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/c10/macros/Macros.h:228,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/c10/core/DeviceType.h:8,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/c10/core/Device.h:3,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/c10/core/Allocator.h:6,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/ALPR_Cpp/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/ALPR_Cpp/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/9/bits/ios_base.h:230:27: error: #if with no expression
  230 | #if _GLIBCXX_USE_CXX11_ABI
      |                           ^
/usr/include/c++/9/bits/ios_base.h:254:27: error: #if with no expression
  254 | #if _GLIBCXX_USE_CXX11_ABI
      |                           ^
In file included from /home/jets/Desktop/ALPR_Cpp/torch/include/c10/macros/Macros.h:228,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/c10/core/DeviceType.h:8,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/c10/core/Device.h:3,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/c10/core/Allocator.h:6,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/ALPR_Cpp/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/ALPR_Cpp/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/9/sstream:309:27: error: #if with no expression
  309 | #if _GLIBCXX_USE_CXX11_ABI
      |                           ^
In file included from /usr/include/c++/9/sstream:879,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/c10/macros/Macros.h:228,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/c10/core/DeviceType.h:8,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/c10/core/Device.h:3,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/c10/core/Allocator.h:6,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/ATen/ATen.h:7,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/ALPR_Cpp/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/ALPR_Cpp/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/9/bits/sstream.tcc:92:27: error: #if with no expression
   92 | #if _GLIBCXX_USE_CXX11_ABI
      |                           ^
In file included from /usr/include/c++/9/locale:41,
                 from /usr/include/c++/9/iomanip:43,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/c10/util/logging_is_not_google_glog.h:8,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/c10/util/Logging.h:28,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/c10/core/TensorImpl.h:19,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/ATen/core/TensorBody.h:14,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/ATen/Tensor.h:3,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/ATen/Context.h:4,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/ATen/ATen.h:9,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/ALPR_Cpp/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/ALPR_Cpp/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/9/bits/locale_facets_nonio.h:721:27: error: #if with no expression
  721 | #if _GLIBCXX_USE_CXX11_ABI
      |                           ^
/usr/include/c++/9/bits/locale_facets_nonio.h:1569:33: error: operator '&&' has no right operand
 1569 |       && _GLIBCXX_USE_CXX11_ABI == 0
      |                                 ^~
/usr/include/c++/9/bits/locale_facets_nonio.h:1592:33: error: operator '&&' has no right operand
 1592 |       && _GLIBCXX_USE_CXX11_ABI == 0
      |                                 ^~
/usr/include/c++/9/bits/locale_facets_nonio.h:1714:33: error: operator '&&' has no right operand
 1714 |       && _GLIBCXX_USE_CXX11_ABI == 0
      |                                 ^~
/usr/include/c++/9/bits/locale_facets_nonio.h:1749:33: error: operator '&&' has no right operand
 1749 |       && _GLIBCXX_USE_CXX11_ABI == 0
      |                                 ^~
In file included from /usr/include/c++/9/bits/locale_facets_nonio.h:2015,
                 from /usr/include/c++/9/locale:41,
                 from /usr/include/c++/9/iomanip:43,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/c10/util/logging_is_not_google_glog.h:8,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/c10/util/Logging.h:28,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/c10/core/TensorImpl.h:19,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/ATen/core/TensorBody.h:14,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/ATen/Tensor.h:3,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/ATen/Context.h:4,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/ATen/ATen.h:9,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/torch/csrc/api/include/torch/types.h:3,
                 from /home/jets/Desktop/ALPR_Cpp/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/ALPR_Cpp/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/9/bits/locale_facets_nonio.tcc:353:33: error: operator '&&' has no right operand
  353 |       && _GLIBCXX_USE_CXX11_ABI == 0
      |                                 ^~
/usr/include/c++/9/bits/locale_facets_nonio.tcc:565:33: error: operator '&&' has no right operand
  565 |       && _GLIBCXX_USE_CXX11_ABI == 0
      |                                 ^~
In file included from /usr/include/c++/9/list:63,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/ATen/core/dispatch/OperatorEntry.h:17,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/ATen/core/dispatch/Dispatcher.h:6,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/torch/csrc/jit/runtime/operator.h:6,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/torch/csrc/jit/ir/ir.h:7,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/torch/csrc/jit/api/function_impl.h:4,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/torch/csrc/jit/api/method.h:7,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/torch/csrc/jit/api/object.h:6,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/torch/csrc/jit/frontend/tracer.h:9,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/torch/csrc/autograd/generated/variable_factories.h:12,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/torch/csrc/api/include/torch/types.h:7,
                 from /home/jets/Desktop/ALPR_Cpp/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/ALPR_Cpp/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/9/bits/stl_list.h:105:27: error: #if with no expression
  105 | #if _GLIBCXX_USE_CXX11_ABI
      |                           ^
/usr/include/c++/9/bits/stl_list.h:115:28: error: #if with no expression
  115 | # if _GLIBCXX_USE_CXX11_ABI
      |                            ^
/usr/include/c++/9/bits/stl_list.h:140:28: error: #if with no expression
  140 | # if _GLIBCXX_USE_CXX11_ABI
      |                            ^
/usr/include/c++/9/bits/stl_list.h:152:27: error: #if with no expression
  152 | #if _GLIBCXX_USE_CXX11_ABI
      |                           ^
/usr/include/c++/9/bits/stl_list.h:399:27: error: #if with no expression
  399 | #if _GLIBCXX_USE_CXX11_ABI
      |                           ^
/usr/include/c++/9/bits/stl_list.h:640:27: error: #if with no expression
  640 | #if _GLIBCXX_USE_CXX11_ABI
      |                           ^
/usr/include/c++/9/bits/stl_list.h:1993:27: error: #if with no expression
 1993 | #if _GLIBCXX_USE_CXX11_ABI
      |                           ^
/usr/include/c++/9/bits/stl_list.h:2062:27: error: #if with no expression
 2062 | #if _GLIBCXX_USE_CXX11_ABI
      |                           ^
In file included from /usr/include/c++/9/list:64,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/ATen/core/dispatch/OperatorEntry.h:17,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/ATen/core/dispatch/Dispatcher.h:6,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/torch/csrc/jit/runtime/operator.h:6,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/torch/csrc/jit/ir/ir.h:7,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/torch/csrc/jit/api/function_impl.h:4,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/torch/csrc/jit/api/method.h:7,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/torch/csrc/jit/api/object.h:6,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/torch/csrc/jit/frontend/tracer.h:9,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/torch/csrc/autograd/generated/variable_factories.h:12,
                 from /home/jets/Desktop/ALPR_Cpp/torch/include/torch/csrc/api/include/torch/types.h:7,
                 from /home/jets/Desktop/ALPR_Cpp/vision/torchvision/csrc/io/image/cpu/decode_image.h:3,
                 from /home/jets/Desktop/ALPR_Cpp/vision/torchvision/csrc/io/image/cpu/decode_image.cpp:1:
/usr/include/c++/9/bits/list.tcc:179:27: error: #if with no expression
  179 | #if _GLIBCXX_USE_CXX11_ABI
      |                           ^
CMakeFiles/torchvision.dir/build.make:89: recipe for target 'CMakeFiles/torchvision.dir/torchvision/csrc/io/image/cpu/decode_image.cpp.o' failed
make[2]: *** [CMakeFiles/torchvision.dir/torchvision/csrc/io/image/cpu/decode_image.cpp.o] Error 1
CMakeFiles/Makefile2:82: recipe for target 'CMakeFiles/torchvision.dir/all' failed
make[1]: *** [CMakeFiles/torchvision.dir/all] Error 2
Makefile:135: recipe for target 'all' failed
make: *** [all] Error 2