mmdetection训练出现:IndexError: list index out of range 错误
mmdetection训练出现:IndexError: list index out of range 错误
文章目录:
- 1 问题分析
- 1.1 尝试解决错误:第一次
- 1.2 尝试解决错误:第二次
- 2 我的问题解决方式
我的环境:
Ubuntu18.04
TorchVision: 0.6.0
OpenCV: 4.2.0
MMCV: 0.5.5
MMDetection: 2.0.0+d9c8f14
MMDetection Compiler: GCC 7.5
MMDetection CUDA Compiler: 10.2
训练的模型是:Retinanet
1 问题分析
在使用mmdetection2.0框架
训练目标检测模型时候,出现IndexError: list index out of range
错误,具体内容如下图,首先从这个错误的类型我们可以看出是索引超过了列表的长度,导致IndexError错误
。
1.1 尝试解决错误:第一次
根据这个错误,很容易想到是否是类别写的不正确,于是去检查如下三个文件:
mmdetection/mmdet/datasets/voc.py
:中的CLASSED变量对应的类别是否正确mmdetection/mmdet/core/evaluation/class_names.py
:voc_classes()函数返回的类别是否正确mmdetection/configs/_base_/models/retinanet_r50_fpn.py
:中num_classes对应的类别数是否正确
结果反复检查了好几遍,还是没有解决这个问题,当然如果你遇到这个问题,很可能就是因为类别写的不对,你一定要仔细、仔细、仔细检查
。
1.2 尝试解决错误:第二次
自己解决不了,于是就去逛github mmdetection的官网,然后乖乖查看issues
,issues中好多说是类别的问题,还有一个人说是学习率太大导致的,我一脸迷惑,信以为真,就尝试了一下(参考)
ONE YEARS LATER
一顿尝试,最终还是不行,错误重现!!!
2 我的问题解决方式
我最开始编译的mmdetection环境路径为:
/home/shl/shl/mmdetection
但是我后面训练自己的另外一个数据集的时候,是直接把这个编译好的mmdetection拷贝一份出来,会出一定的问题,比如:
cp -r mmdetection mmdetection_clothes
然后在/home/shl/shl/mmdetection_clothes
中修改类别,但是最终还是会去:/home/shl/shl/mmdetection/mmdet
下面读取类别信息,用pip list 可以查看到mmdetection的路径
(mmdetection) shl@zfcv:~/shl/mmdetection$ pip list
Package Version Location
---------------------- ------------------- -------------------------
absl-py 0.9.0
addict 2.2.1
cachetools 4.1.0
certifi 2020.4.5.1
chardet 3.0.4
click 7.1.2
cycler 0.10.0
Cython 0.29.19
Flask 1.1.2
future 0.18.2
google-auth 1.17.2
google-auth-oauthlib 0.4.1
grpcio 1.29.0
idna 2.9
importlib-metadata 1.6.1
itsdangerous 1.1.0
Jinja2 2.11.2
kiwisolver 1.2.0
Markdown 3.2.2
MarkupSafe 1.1.1
matplotlib 3.2.1
mmcv 0.5.5
mmdet 2.0.0+d9c8f14 /home/shl/shl/mmdetection # 这里可以看到,mmdetection_clothes训练时还是在这里调用mmdet下的类别相关信息
numpy 1.18.4
oauthlib 3.1.0
opencv-python 4.2.0.34
pandas 1.0.4
Pillow 7.1.2
pip 20.0.2
protobuf 3.12.2
pyasn1 0.4.8
pyasn1-modules 0.2.8
pycocotools 2.0
pyparsing 2.4.7
python-dateutil 2.8.1
pytz 2020.1
PyYAML 5.3.1
requests 2.23.0
requests-oauthlib 1.3.0
rsa 4.6
scipy 1.4.1
seaborn 0.10.1
setuptools 46.4.0.post20200518
six 1.15.0
tensorboard 2.2.2
tensorboard-plugin-wit 1.6.0.post3
terminaltables 3.1.0
torch 1.5.0
torchvision 0.6.0
tqdm 4.46.1
urllib3 1.25.9
Werkzeug 1.0.1
wheel 0.34.2
yapf 0.30.0
zipp 3.1.0
(mmdetection) shl@zfcv:~/shl/mmdetection$
所以最后的解决方式,在/home/shl/shl/mmdtection
这个原始的路径下修改类别,然后训练,不要拷贝出来一份!我就是想训练多个数据集才这样干的,至于后面有没有什么解决方式,我再尝试!
mmdetection训练出现:IndexError: list index out of range 错误相关推荐
- 成功解决sys.argv[1] IndexError: list index out of range错误
成功解决sys.argv[1] IndexError: list index out of range错误 目录 解决问题 解决思路 解决办法 解决问题 sys.argv[1] IndexError: ...
- IndexError: list index out of range 错误原理及解决方法(python)
list index out of range 解决思路 发现问题 当我在写文章金融数据分析(一)python预热中的项目二:计算手机销量年增长率的时候,出现过如下报错: 看着结果是已经跑出来了,但是 ...
- python常遇错误-IndexError: list index out of range
Python中包含错误和异常两种情况①,错误主要是常见的语法错误SyntaxError,如下图所示,并且在错误提示中会有倒三角箭头的修改指示位置:python中的另外一种错误提醒叫做异常,指的是在语法 ...
- maskrcnn训练问题报错:selected_polygons.append(self.polygons[i]) IndexError: list index out of range
训练mask rcnn实例分割时报错: Traceback (most recent call last):File "tools/train_net.py", line 203, ...
- 成功解决.append方法出现错误IndexError: list index out of range
成功解决.append方法出现错误IndexError: list index out of range 目录 解决问题 解决方法 解决问题 .append方法出现错误IndexError: list ...
- maskrcnn selected_polygons.append(self.polygons[i]) IndexError: list index out of range
项目场景: maskrcnn训练问题报错:selected_polygons.append(self.polygons[i]) IndexError: list index out of range ...
- face_recognition IndexError: list index out of range
再利用face_recognition做人脸识别的时候训练人脸图片时报错: face_recognition IndexError: list index out of range 主要代码定位到:增 ...
- IndexError: list index out of range的解决办法
IndexError: list index out of range的解决办法 列表的索引也就是他的元素的个数是没有你所想要找的元素位置,比如这个列表只有十个元素你要找第11个元素这个肯定找不到 解 ...
- 爬虫时出现 IndexError: list index out of range 的原因
爬虫时出现 IndexError: list index out of range 的原因有两种: 简单举例如下: 第一种情况: index越界 Alex = [1,2,3] Alex[1] 2 Al ...
最新文章
- linux定时任务Crond基础概念原理介绍01
- io.h源码 检查文件是否存在
- 常用JS图片滚动(无缝、平滑、上下左右滚动)代码大全
- net以execl做数据库_[原创]Net实现Excel导入导出到数据库(附源码)
- tf.summary.FileWriter
- 力扣 距离顺序排列矩阵单元格
- 【离散数学】第五版前四章知识网图
- matlab常用符号意思,matlab常用的符号
- 八选一数据选择器(两种写法)
- redis设置零点过期,网站浏览量
- 分布式事务与RocketMq 事务消息
- 实战录 | Spring中bean的生命周期
- 手把手教你用键盘开机
- 软件测试——界面测试
- 42、使用mmrotate中k3det进行旋转目标检测,并进行mnn部署和ncnn部署
- Java应用CPU占用过高问题排查
- BISHIMIANSHI
- 同花顺_代码解析_技术指标_P、Q
- Android屏幕监视方法,Android 关于手机屏幕的那些事
- Pr 与 Ae 的动态链接
热门文章
- FMS4.5( Adobe Flash Media Server4.5)流媒体服务器搭建
- 从官网下载的python包如何使用-如何使用Python从需要登录信息的网站下载文件?...
- python3.6.4安装教程-Centos7 安装Python3.6.4
- python urllib.request 爬虫 数据处理-python 爬虫之 urllib库
- python处理csv数据-Python处理csv文件
- 零基础是学java还是python-零基础更适合学习Java还是python?
- 如何打开python的交互窗口-使用Python显示图形交互窗口
- python中文软件-Python3.8.3下载
- 0基础学python难吗-0基础学武汉Python开发课程有多难?该怎么入门?
- 小学生python-用Python实现小学生四则运算