博客搬移到:https://blog.csdn.net/u013171226/article/details/107680337
上一篇文章里面記錄了在xavier NX上安裝pytorch,https://www.cnblogs.com/cumtchw/p/13273753.html
然后接下來安裝torchvision,下面是英偉達官網上的torchvision的安裝方法:https://forums.developer.nvidia.com/t/pytorch-for-jetson-nano-version-1-5-0-now-available/72048
$ sudo apt-get install libjpeg-dev zlib1g-dev $ git clone --branch <version> https://github.com/pytorch/vision torchvision # see below for version of torchvision to download $ cd torchvision $ sudo python setup.py install $ cd ../ # attempting to load torchvision from build dir will result in import error $ pip install 'pillow<7' # always needed for Python 2.7, not needed torchvision v0.5.0+ with Python 3.6
然后下面是torch和torchvision的版本對應關系。
而我們安裝的torch版本是1.6版本,並沒有對應的torchvison,於是我直接從github上面下載最新的torchvision,https://github.com/pytorch/vision
然后用下面命令安裝
$ cd torchvision $ sudo python setup.py install $ cd ../ # attempting to load torchvision from build dir will result in import error
然后用下面的命令進行測試
python3 import torchvison
torchvision.__version__