本文旨在安装mmrotate dev 1.x的版本,从源码安装。由于目前官方给定的教程存在错误,此处安装步骤将有所差异。
基本环境配置:
python 3.8.12
torch 1.8.1
cuda 10.2
显卡 1660Ti / 3060好像cuda版本存在不同
基本环境安装命令:
conda create -n mmdet-dev python=3.8.12
conda install pytorch==1.8.1 torchvision==0.9.1 torchaudio==0.8.1 cudatoolkit=10.2
下面首先给出需要安装的库链接:
mmcv 2.0.0rc4 open-mmlab/mmcv at 2.x (github.com)
mmengine 0.7.2 open-mmlab/mmengine: OpenMMLab Foundational Library for Training Deep Learning Models (github.com)
mmdet 3.0.0 open-mmlab/mmdetection at 3.x (github.com)
mmrotate 1.0.0rc1 open-mmlab/mmrotate at dev-1.x (github.com)
mmsegmentation 0.23.0 open-mmlab/mmsegmentation: OpenMMLab Semantic Segmentation Toolbox and Benchmark. (github.com) [注意:若要与其他mm库混用,此库最好升级为dev版本]
安装命令的顺序如下,采用了mim安装mmcv, mmengine, mmdet;完成后使用pip删除mmcv-full
conda install git
pip install -U openmim
mim install mmengine
mim install "mmcv==2.0.0rc4"
mim install "mmcls==1.0.0rc6"
mim install "mmdet>=3.0.0rc2"
下载源码文件,链接:open-mmlab/mmrotate at 1.x (github.com),就是下载zip后解压。解压后将文件放入对应环境的site package文件夹中,运行下列命令。
cd E:\Anaconda\envs\mmdet-dev\Lib\site-packages\mmrotate-1.x // 这行每个人不一样,自己看好自己放在哪里
pip install -r requirements.txt // 此行若无法正常下载,请重开命令行窗口重试(可能是git的问题?)
pip install -v -e .
pip install -U Pillow
安装完毕后,运行下列代码,无误即成功安装。
import argparse import logging import os import os.path as osp from mmdet.utils import register_all_modules as register_all_modules_mmdet from mmcls.utils import register_all_modules as register_all_modules_mmcls from mmengine.config import Config, DictAction from mmengine.logging import print_log from mmengine.registry import RUNNERS from mmengine.runner import Runner from mmrotate.utils import register_all_modules if __name__ == '__main__': register_all_modules_mmcls() register_all_modules_mmdet() register_all_modules() print('all completed!')
结果如下:
标签:教程,MMRotate,register,modules,dev,mmdet,install,import,mmengine From: https://www.cnblogs.com/lzqdeboke/p/17335742.html