解决pil.unidentifiedimageerror: cannot identify image file

您所在的位置:网站首页 灯具分类及特点有哪些 解决pil.unidentifiedimageerror: cannot identify image file

解决pil.unidentifiedimageerror: cannot identify image file

2023-08-16 09:23| 来源: 网络整理| 查看: 265

解决pil.unidentifiedimageerror: cannot identify image file

我们去找点朋友吧: [code=python] import os from PIL import Image def image_processing(): all_file_names = os.listdir('./') for file_name in all_file_names: #print(file_name) if 'jpg' in file_name: img_path = Image.open(f'./{file_name}') img_size = img_path.resize((3840, 2160)) img_size.save(f'./{file_name}', 'JPEG') if __name__ == '__main__': image_processing() [/code]

从零开始在Linux服务器中搭建yolov5环境

绛君绛君: 请问fusing layers非法指令怎么解决啊

从零开始在Linux服务器中搭建yolov5环境

weixin_42944283: 博主,您好import包的时候报错:import: unable to open X server `' @ error/import.c/ImportImageCommand/364. 尝试了添加 #!/usr/bin/env python,仍然报错,请问有什么解决方案吗?谢谢

解决pil.unidentifiedimageerror: cannot identify image file

m0_68133948: 感谢已经解决了我发现图片换成bmp就可以显示了,我的训练文件夹多了__init__.py所以不能生成训练数据

解决pil.unidentifiedimageerror: cannot identify image file

sake-: pgm图片?你试试装pgm图片转成jpg看看是否可以,或者降低pillow的版本,我的pillow是8.3.2,不行的话就可能需要捕获异常来跳过该次异常了



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3