【labelme的使用】"IndexError: list index out of range" when edit label
前言
使用labelme,想要改变之前标注的label名称,使用的是一个新的类别名称,比如原来是off_red/ off_green,想要将这些类别名称全部改为off,使用labelme的过程中出错,故此记录。
labelme的版本
conda list | grep labelme
labelme的版本是5.0.1;
错误:
Traceback (most recent call last): File "/home/uu/miniconda3/envs/labelme/lib/python3.9/site-packages/labelme/app.py", line 1075, in editLabel self._update_shape_color(shape) File "/home/uu/miniconda3/envs/labelme/lib/python3.9/site-packages/labelme/app.py", line 1155, in _update_shape_color r, g, b = self._get_rgb_by_label(shape.label) File "/home/uu/miniconda3/envs/labelme/lib/python3.9/site-packages/labelme/app.py", line 1165, in _get_rgb_by_label item = self.uniqLabelList.findItemsByLabel(label)[0] IndexError: list index out of range Aborted (core dumped)
解决方法:
修改了 /home/xxx/miniconda3/envs/labelme/lib/python3.9/site-packages/labelme/app.py文件中的部分内容;
I use the label adding logic that appears in addLabel()
function here.
在文件同样的位置添加图中绿色框的内容,删除红色框的内容即可;
参考
1. [BUG] "IndexError: list index out of range" when edit label #963;
2. fix bug in editLabel #1151;
完
各美其美,美美与共,不和他人作比较,不对他人有期待,不批判他人,不钻牛角尖。
心正意诚,做自己该做的事情,做自己喜欢做的事情,安静做一枚有思想的技术媛。
版权声明,转载请注明出处:https://www.cnblogs.com/happyamyhope/
心正意诚,做自己该做的事情,做自己喜欢做的事情,安静做一枚有思想的技术媛。
版权声明,转载请注明出处:https://www.cnblogs.com/happyamyhope/