当前位置:网站首页>mmdetection的安装和训练、测试didi数据集的步骤(含结果)
mmdetection的安装和训练、测试didi数据集的步骤(含结果)
2022-08-11 05:35:00 【KPer_Yang】
目录
安装pytorch 1.3
conda create -n open-mmlab python=3.7 -y
conda init bash
conda activate open-mmlab
conda install pytorch=1.3.1 cudatoolkit=9.2 torchvision=0.4.2 -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/linux-64/安装mmcv
pip install mmcv-full==1.0.5 -f https://download.openmmlab.com/mmcv/dist/cu92/torch1.3.0/index.html安装mmdet
1、pip install mmdet==2.3.0
#github下载mmdetection的2.3.0版本的源码安装额外的包
pip install Pillow==6.2.2
pip install cython安装cocoapi
git+https://github.com/open-mmlab/cocoapi.git #手动下载离线安装包
python setup.py install根据数据集修改文件
mmdetection/mmdet/datasets/coco.py #coco修改成自定义数据集类别
mmdetection/mmdet/core/evaluation/class_names.py #coco修改成自定义数据集类别
mmdetection/mmdet/configs/_bash_/models/faster_rcnn_r50_fpn.py #修改类别数,num_classes=12
# 修改方法1:vim ;方法2:cp 到/home/aistdio 可以直接打开
mmdetection/mmdet/datasets/custom.py #注释下面两行
#if self.custom_classes:
# self.data_infos=self.get_subset_by_classes()将环境持久化
cp -r open-mmlab/ /home/aistudio/external-libraries #复制
cp -r /home/aistudio/external-libraries/open-mmlab /opt/conda/env #复制回去
# in ~/.bashrc 或者修改conda env的路径
export CONDA_ENVS_PATH=/home/aistudio/external-libraries/open-mmlab运行didi训练脚本
python tools/train.py configs/faster_rcnn/faster_rcnn_r50_fpn_1x_didi.py
#2、手动下载 https://download.pytorch.org/models/resnet50-19c8e357.pth
#3、复制文件到 cp /home/aistudio/.cache/torch/checkpoints/resnet50-19c8e357.pth测试didi数据集
python tools/test.py configs/faster_rcnn/faster_rcnn_r50_fpn_soft_nms_1x_didi.py ./work_dirs/faster_rcnn_r50_fpn_soft_nms_1x_didi/latest.pth --format-only --options "jsonfile_prefix=./test_results" --show-dir "./show_result"
# 报错1:ModuleFoundError no module named 'tools'
# 报错1解决方法1:注释掉import tools 和使用的两行,因为if条件没有进去
# 报错1解决方法2:手动将tool文件的函数复制到当前文件中
# 报错2:IndexError:list index out of range
# 报错2解决:前面的“根据数据集修改文件”常用ubuntu命令
unzip -oq /home/aistudio/work/mmdetection-2.3.0.zip #解压
cp -r dir1 dir2 # 复制
tar -vcf test.tar test # 压缩
vim filename #编辑:i ;退出编辑:exc ; 保存::wq实验结果图


边栏推荐
猜你喜欢
随机推荐
Eight-legged text jvm
View the library ldd that the executable depends on
HCIP OSPF动态路由协议
HCIP 重发布/路由策略实验
HPC platform building
xx is not recognized as internal or external command
WiFi Deauth 攻击演示分析 // mdk4 // aireplay-ng// Kali // wireshark //
AUTOMATION DAY06 (Ansible Advanced, Ansible Role)
ovnif摄像头修改ip
[损失函数]——均方差
MySQl进阶之索引结构
OA项目之待开会议&历史会议&所有会议
HCIP Republish/Routing Policy Experiment
华为防火墙-6
HCIA知识复习
Memory debugging tools Electric Fence
什么是Inductive learning和Transductive learning
FusionCompute8.0.0 实验(2)虚拟机创建
Windos10专业版开启远程桌面协助
Numpy_备注









