显卡3090
cuda11.1
ubuntu20.04
创建环境
conda create -n swin python=3.8
source activate swin
安装pytorch
conda install pytorch==1.8.0 torchvision==0.9.0 torchaudio==0.8.0 cudatoolkit=11.1 -c pytorch -c conda-forge
安装其他
一定要分别单独按顺序安装
pip install cython matplotlib opencv-python termcolor==1.1.0 yacs==0.1.8
安装mmdetection
https://github.com/open-mmlab/mmcv
pip install mmcv-full==1.3.8 -f https://download.openmmlab.com/mmcv/dist/cu111/torch1.8.0/index.html
pip install -r requirements/build.txt
python setup.py develop
安装apx
下载地址:https://github.com/NVIDIA/apex
cd apex
pip install -v --disable-pip-version-check --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./
下载权重
所有权重:https://github.com/SwinTransformer/Swin-Transformer-Object-Detection
本次demo权重:https://github.com/SwinTransformer/storage/releases/download/v1.0.2/mask_rcnn_swin_tiny_patch4_window7.pth
运行demo
python demo/image_demo.py demo/demo.jpg configs/swin/mask_rcnn_swin_tiny_patch4_window7_mstrain_480-800_adamw_3x_coco.py mask_rcnn_swin_tiny_patch4_window7.pth
训练
python tools/train.py configs/swin/mask_rcnn_swin_tiny_patch4_window7_mstrain_480-800_adamw_3x_coco.py --cfg-options model.pretrained=mask_rcnn_swin_tiny_patch4_window7.pth
版权声明:本文为CSDN博主「大千视界」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_39821101/article/details/122306570
暂无评论