当前位置:网站首页>配置mmdet来训练Swin-Transformer之一配置环境
配置mmdet来训练Swin-Transformer之一配置环境
2022-08-02 03:21:00 【& Tom】
本地环境:Ubuntu18.04 、Pycharm、默认安装了anconda3!
1. 创建一个虚拟环境!!!注意!!!安装包一定要一致!(Medetect为我的环境名可自行设置, python版本是为了和我其他环境一样,可自行设置)
conda create -n Medetect python==3.8.5
2. 环境创建完成后,激活环境并,一定要先安装Pytorch !(后面mmcv需要pytorch)!
版本要一样,否则会出现 XX_dim 参数错误(github上issue有这个问题,但我也没能解决),或者cuda错误(这个一般是pytorch版本或这cuda版本导致),亲测这个版本好用!别的版本各种问题!
#激活环境
conda activate Medetect
# 安装pytorch 基于 CUDA 11.0
conda install pytorch==1.7.1 torchvision==0.8.2 torchaudio==0.7.2 cudatoolkit=11.0 -c pytorch
3. pytorch安装完成后,补充几个安装包
pip install cython matplotlib opencv-python
4. 安装包完成,最关键的部分!安装mmcv ! (我的版本亲测好用,我从最新的版本换到1.4.0才好用)
pip install mmcv-full==1.4.0 -f https://download.openmmlab.com/mmcv/dist/cu110/torch1.7.0/index.html
安装很快,等安装完成后,conda list 以下,看看是不是 mmcv-full 1.4.0 版本,如果是1.4.1那也得重新装(我遇到一次打错版本号安装了1.4.1,报错不兼容)
5. 安装完成后,接下来安装mmdet==2.11.0 (我只有这个版本好用,沃哭里)
这里需要用到Swin-Transformer 的安装包,git到本地进入文件夹路径后,直接分别来两句,即可
pip install -r requirements.txt
python setup.py develop
注意:我这里用的是swin的包来编译的mmdet,也可以直接(没试过):
pip install mmdet==2.11.0
6. 最后一步,安装apex ,训练swin的时候使用,(最好用源码的方式安装,直接pip我试过不好用)。下载apex包放在项目的大路径下,直接安装即可,等待完成。
cd apex
python setup.py develop
7. 检测
需要下载文件:mask_rcnn_swin_tiny_patch4_window7.pth
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
结果:
配置基本完成。
我在训练时遇到了 CUDA:。。。。。。一堆乱七八遭的,说明版本不对应,重新检查以下版本就好。
慢慢来,比较快!
边栏推荐
- AttributeError: ‘Upsample‘ object has no attribute ‘recompute_scale_factor‘
- DSPE-PEG-Silane,DSPE-PEG-SIL,磷脂-聚乙二醇-硅烷修饰活性基团
- Chemical reagent Phospholipid-polyethylene glycol-hydroxyl, DSPE-PEG-OH, DSPE-PEG-Hydroxyl, MW: 5000
- UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the index ing argu
- 腾讯50题
- Cloud server installation and deployment of Nacos 2.0.4 version
- 排序学习笔记(二)堆排序
- @Accessors 注解详解
- Detailed explanation of the usage of exists in mysql
- 磷脂-聚乙二醇-酰肼,DSPE-PEG-Hydrazide,DSPE-PEG-HZ,MW:5000
猜你喜欢
科研试剂DMPE-PEG-Mal 二肉豆蔻酰磷脂酰乙醇胺-聚乙二醇-马来酰亚胺
MySql创建数据表
@Configuration详解
HCIP-第十一天-MPLS+BGP
化学试剂磷脂-聚乙二醇-羟基,DSPE-PEG-OH,DSPE-PEG-Hydroxyl,MW:5000
UserWarning:火炬。meshgrid:在以后的版本中,它将被要求通过索引ing argu
UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the index ing argu
ModuleNotFoundError No module named ‘xxx‘可能的解决方案大全
Phospholipid-polyethylene glycol-thiol, DSPE-PEG-Thiol, DSPE-PEG-SH, MW: 5000
【深度学习】从LeNet-5识别手写数字入门深度学习
随机推荐
Knowledge Engineering Assignment 2: Introduction to Knowledge Engineering Related Fields
MySQL8.0与MySQL5.7差异分析
ImportError: libGL.so.1: cannot open shared object file: No such file or directory
mysql中exists的用法详解
解决glob()返回文件排序不一致问题&onnx本地按照安装方法
MySQL常见的索引
JVM学习----垃圾回收--G1
@Configuration详解
活体检测 Adaptive Normalized Representation Learning for GeneralizableFace Anti-Spoofing 阅读笔记
磷脂-聚乙二醇-叠氮,DSPE-PEG-Azide,DSPE-PEG-N3,MW:5000
Basic usage of Monaco Editor
Debian 10 NTP 服务配置
MySQL中JOIN的用法
手把手带你 Unity 入门之从零创建一个时钟(GameObjects 与 Scripts)
MySQL中的各种锁(行锁、间隙锁、临键锁等等LBCC)
MySQL中字符串比较大小(日期字符串比较问题)
getattr() function analysis
oracle inner join and outer join
mysql中json类型字段用法
AttributeError: Can't get attribute 'SPPF' on