labelme2voc.py无法读取window下生成的json文件
在windows系统下,利用labelme标注图像生成的json文件,图像的路径是反斜杠的,例如:“imagePath”: “…\imgs\28.9_3.jpg”;如果在linunx系统下,运行 python labelme2voc.py --input_dir jsons --output_dir data_dataset_voc --labels labels.txt时,会提示错误:
Failed opening image file: jsons_win/…\stage_first\54_561_f.jpg
Traceback (most recent call last):
File “/home/zhangdeshan/.local/lib/python3.7/site-packages/labelme/label_file.py”, line 117, in load
base64.b64encode(imageData).decode(“utf-8”),
File “/data/envs/conda/lib/python3.7/base64.py”, line 58, in b64encode
encoded = binascii.b2a_base64(s, newline=False)
TypeError: a bytes-like object is required, not ‘NoneType’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “labelme2voc.py”, line 106, in
main(args)
File “labelme2voc.py”, line 52, in main
label_f