解决:使用labelimg打标签时出现错误error opening file

问题描述

  • 收集好图片之后,今天准备使用labelimg工具来给图片打标签,标了一两张图片后,继续标下一张却弹出了错误提示:
    在这里插入图片描述
    原本以为是读取的图片路径中含有中文导致的,可换成不含中文的路径后还是出现了这种错误。网上搜索了一下发现应该是图片格式的问题,而非图片中含有中文路径。

解决方法

from PIL import Image

image_path = "D:/11.png"
image_new_path = "D:/12.png"
image = Image.open(image_path)
image = image.convert('RGB')
image.save(image_new_path)

参考文章:https://blog.csdn.net/xuhong_001/article/details/126530908

猜你喜欢

转载自blog.csdn.net/ungoing/article/details/127973470