Swin transformer目标检测复现object detection遇到的问题及解决

@胖煜Swin transformer目标检测复现object detection遇到的问题及解决

Swin transformer目标检测复现object detection遇到的问题及解决

这周的在实验室的任务是Swin transformer复现,配环境就遇到了一堆问题,足足配了三天,无语子。
activate openmmlab
bash: /home/techart/anaconda3/bin/activate: Permission denied
改为:source activate openmmlab
Command “python setup.py egg_info” failed with error code 1 in /tmp/pip-req-build-ur0nohjs/
1.更新 setuptools 和 pip:
pip install --upgrade setuptools
python -m pip install --upgrade pip
不好使
2.ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output
conda install pytorch1.8.0 torchvision0.9.0 torchaudio==0.8.0 cudatoolkit=11.0 -c pytorch -c conda-forge
不好使
3.Nvidia-smi查看CUDA版本可能不准,需要使用ncvv -V命令
Command not found
安装nc
不好使
4.sudo apt-get install nvidia-cuda-toolkit
不好使
5.whereis cuda
cuda: /usr/lib/cuda /usr/include/cuda.h
cuda竟然不在一般的/usr/local/里面
查看version.txt 果然和nvidia-smi命令下的不一样
Nvidia-smi里面显示的版本是11.0,而version.txt里面显示的是10.1
6.

所以是conda虚拟环境中的cuda有问题
7. conda env remove -n 环境名
重装环境 到pyotrch官网找和CUDA对应的pytorch版本
conda install pytorch1.7.1 torchvision0.8.2 torchaudio==0.7.2 cudatoolkit=10.1 -c pytorch
8. mim install mmdet报错
installing mmdet from https://github.com/open-mmlab/mmdetection.git.
Cloning into ‘/tmp/tmpf9xpof16/mmdetection’…
fatal: unable to access ‘https://github.com/open-mmlab/mmdetection.git/’: GnuTLS recv error (-110): The TLS connection was non-properly terminated.
9. git clone https://github.com/NVIDIA/apex
Cloning into ‘apex’…
fatal: unable to access ‘https://github.com/NVIDIA/apex/’: GnuTLS recv error (-110): The TLS connection was non-properly terminated.
改为:git clone git://github.com/NVIDIA/apex
10. CocoDataset: Incompatible version of pycocotools is installed
Run pip uninstall pycocotools first. Then run pip install mmpycocotools to install open-mmlab forked pycocotools.
11. No such file or directory: ‘data/coco/annotations/instances_train2017.json’
12. UserWarning: “ImageToTensor” pipeline is replaced by “DefaultFormatBundle” for batch inference.
在测试模式下, ImageToTensor pipeline 不建议使用,用 DefaultFormatBundle 来代替,使用手动替换配置文件中的测试数据管道。
在这个地方看到的这个解决办法

你可能感兴趣的:(Swin,transformer,python,pytorch,神经网络,transformer,计算机视觉)