NVIDIA JETSON原始环境python降版本(3.7->3.6)+torch1.6+torchvision0.7+mmcv1.2.4+mmdet1.10.0+运行SWIN demo(纯净版)
Posted 田木子0322
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了NVIDIA JETSON原始环境python降版本(3.7->3.6)+torch1.6+torchvision0.7+mmcv1.2.4+mmdet1.10.0+运行SWIN demo(纯净版)相关的知识,希望对你有一定的参考价值。
1.python降版本
sudo rm -rf /usr/bin/python
sudo ln -s /usr/bin/python3.6 /usr/bin/python
删除原始python版本(3.7)对应软链接
构建python3.6对应的软链接
2.torch1.6(科学上网)
JETSON官方适配torch版本下载https://www.elinux.org/Jetson_Zoo
sudo apt-get install python3-pip libopenblas-base libopenmpi-dev
pip3 install Cython
pip3 install numpy torch-1.6.0-cp36-cp36m-linux_aarch64.whl
import torch报错Illegal instruction (core dumped)
sudo gedit /etc/profile
在末尾添加export OPENBLAS_CORETYPE=ARMV8
保存
source /etc/profile
3.torchvision0.7.0
A.换国内源(否则网速慢,且有可能断连接)
sudo apt-get install libjpeg-dev zlib1g-dev
git clone --branch v0.7.0 https://github.com/pytorch/vision guo
cd guo
sudo python3 setup.py instal
下载完成后更改文件名。
pip3 install torchvision-0.7.0-cp36-cp36m-linux_aarch64.whl
C.官网下载(vision版本号没加cuda102应该是cpu版本,但是torch.cuda.is_available()验证成功)
pip install torchvision==0.7.0 -f https://download.pytorch.org/whl/torch_stable.html
4.上述环节验证
>>> import torch
>>> import torchvision
>>> torch.__version__
>>> torchvision.__version__
>>> torch.cuda.is_available()
5.mmcv1.2.4
pip install mmcv-full==1.2.4 -f https://download.openmmlab.com/mmcv/dist/cu102/torch1.6.0/index.html
6.mmdet2.10.0
git clone https://github.com/open-mmlab/mmdetection.git
cd mmdetection
pip install -v -e .
7.验证上述步骤
>>>import mmcv
>>>import mmdet
8.下载相应文件,放在第一层级文件夹内
mask_rcnn_swin_tiny_patch4_window7.pth
9.Swin-Transformer-Object-Detection运行demo报错KeyError:‘Swin Transformer is not in the backbone registry’
python setup.py develop
以上是关于NVIDIA JETSON原始环境python降版本(3.7->3.6)+torch1.6+torchvision0.7+mmcv1.2.4+mmdet1.10.0+运行SWIN demo(纯净版)的主要内容,如果未能解决你的问题,请参考以下文章