[WARNING] label_file:load:102 - This JSON file (D:\Project\fen_ge_guan\1.json) may be incompatible with current labelme. version in file: 3.16.2, current version: 5.0.1
Traceback (most recent call last):
File "D:/Project/mmsegmentation-0.20.2/mmsegmentation-0.20.2/data/semantic_segmentation/labelme2voc.py", line 110, in <module>
main()
File "D:/Project/mmsegmentation-0.20.2/mmsegmentation-0.20.2/data/semantic_segmentation/labelme2voc.py", line 101, in main
imgviz.rgb2gray(img),
File "D:\anaconda\envs\pytorch\lib\site-packages\imgviz\color.py", line 23, in rgb2gray
assert rgb.shape[2] == 3, "rgb shape must be (H, W, 3)"
AssertionError: rgb shape must be (H, W, 3)
pip install -U labelme
1.升级labelme并重新标注。
2.还有一个问题是使用的是png图片,这是不行的,因为png是RGBA,得使用jpg图片。而且在转换的时候注意,不要用更改文件名的方式xxx.png改为xxx.jpg。同时要修改json文件中的格式说明。