Ubuntu 显卡3090下swin-transformer 目标检测环境配置

显卡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#installation

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

你可能感兴趣的:(目标检测,transformer,目标检测,ubuntu)