转换自己的图片数据集报错
aistudio@jupyter-915968-3484273:~/PaddleSeg/tools$ python labelme2seg.py linetest
Creating annotations directory: linetest/annotations
class_names: ('_background_', 'line')
Saved class_names: linetest/class_names.txt
Generating dataset from: linetest/001.json
Generating dataset from: linetest/istockphoto-539959750-1024x1024.json
Traceback (most recent call last):
File "labelme2seg.py", line 125, in
main(args)
File "labelme2seg.py", line 86, in main
class_name_mapping=class_name_to_id,
File "labelme2seg.py", line 118, in shape2label
label_mask = shape2mask(img_size[:2], points)
File "labelme2seg.py", line 103, in shape2mask
label_mask = PIL.Image.fromarray(np.zeros(img_size[:2], dtype=np.uint8))
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/PIL/Image.py", line 2786, in fromarray
size = 1 if ndim == 1 else shape[1], shape[0]
IndexError: tuple index out of range
首先你说了一个寂寞,没有类型没有模型,啥都没有来了一个报错
而且报错内容是元组索引超出范围,这个问题应该很好排查的
建议:下一次先看报错进行自己排查,然后问问题把问题写清晰来如果不会写可以参考:https://aistudio.baidu.com/paddle/forum/topic/show/992309