tensorflow读取jpg格式图片报错 ValueError: Only know how to handle extensions: ['png']; with Pillow installed matplotlib can handle more images

当运行mpimg.imread("img.jpg")时,spyder 出现如下错误:

ValueError: Only know how to handle extensions: [‘png‘]; with Pillow installed matplotlib can handle more images

解决办法就是  安装pillow即可

我是在anaconde里安装的很简单,执行如下步骤即可:

tensorflow读取jpg格式图片报错 ValueError: Only know how to handle extensions: ['png']; with Pillow installed matplotlib can handle more images

原文地址:https://www.cnblogs.com/guohaoblog/p/9797064.html

时间: 2024-07-30 12:41:22

tensorflow读取jpg格式图片报错 ValueError: Only know how to handle extensions: ['png']; with Pillow installed matplotlib can handle more images的相关文章

keras 报错 ValueError: Tensor conversion requested dtype int32 for Tensor with dtype float32: 'Tensor("embedding_1/random_uniform:0", shape=(5001, 128), dtype=float32)'

在服务器上训练并保存模型,复制到本地之后load_model()报错: ValueError: Tensor conversion requested dtype int32 for Tensor with dtype float32: 'Tensor("embedding_1/random_uniform:0", shape=(5001, 128), dtype=float32)' 原因:服务器和本地的运行环境配置不同 查看本地keras版本: In [1]: import kera

python 读取数据库,老是报错。

在8.04.4环境下(其实我觉得跟环境无关,是我语句有问题): $ dpkg -l | grep -i python ii  libapache2-mod-python                 3.3.1-2build1               Apache 2 module that embeds Python within th ii  moinmoin-common                       1.5.8-5.1ubuntu2.5          Python

matplotlib.pyplot import报错: ValueError: _getfullpathname: embedded null character in path

Environment: Windows 10, Anaconda 3.6 matplotlib 2.0 import matplotlib.pyplot 报错: ValueError: _getfullpathname: embedded null character in path 原因以及Solution: http://stackoverflow.com/questions/34004063/error-on-import-matplotlib-pyplot-on-anaconda3-f

android studio 报错-----R全部显示红色 ---- .9图片报错

导入android项目后,R全部变红,控制台有下面的提示 意思是缺少一些资源,比如说图片之类的,然后我发现确实少了一张图片资源,导入图片资源后,依旧报错,如下  Error:Execution failed for task ':generalAPPN:mergeDebugResources'.  查阅了一些资料,发现是由于.9 png图片有问题,android studio "点九"是andriod平台的应用软件开发里的一种特殊的图片形式,文件扩展名为:.9.png 智能手机中有自动

shutil.copytree拷贝目录到cifs格式路径报错临时解决办法

shutil.copytree拷贝目录到cifs格式路径报错临时解决办法: 报错原因: 我理解是因为不能保留cifs路径的目录原时间戳(提示权限拒绝),非cifs格式路径不存在该问题 临时解决办法: 通过os.system调用另1个shell脚本(rsync拷贝目录)解决,rsync也是报权限拒绝,不过区别是rsync不影响脚本继续进行(shutil.copytree是直接报错终止) 原文地址:http://blog.51cto.com/yangzhiming/2135844

Python读取CSV文件,报错:UnicodeDecodeError: 'gbk' codec can't decode byte 0xa7 in position 727: illegal multibyte sequence

Python读取CSV文件,报错:UnicodeDecodeError: 'gbk' codec can't decode byte 0xa7 in position 727: illegal multibyte sequence 解决办法: 在语句open(sFileName,newline='')中,增加encoding='UTF-8',如下: open(sFileName,newline='',encoding='UTF-8') Python读取CSV文件,报错:UnicodeDecode

ansible报错Aborting, target uses selinux but python bindings (libselinux-python) aren't installed

报错内容: TASK [activemq : jvm configuration] **********************************************************fatal: [172.16.1.10]: FAILED! => {"changed": false, "checksum": "9b18306fa15628e687c3a81332f9bmsg": "Aborting, target

ansible报错Aborting, target uses selinux but python bindings (libselinux-python) aren't installed【转】

报错内容: TASK [activemq : jvm configuration] **********************************************************fatal: [172.16.1.10]: FAILED! => {"changed": false, "checksum": "9b18306fa15628e687c3a81332f9bmsg": "Aborting, target

Android Studio添加PNG图片报错原因

今天在网上看到一个关于Splash Activity的Android帖子,博主在一通讲解之后也给出了代码.于是果断下载下来了看看怎么实现的.一步步照着流程把这个功能实现了一遍.一切都没有大问题,但是在gradle编译期间提示报错: libpng error: Not a PNG file  从提示上看很简洁很明了,添加的资源不属于PNG格式的.但是我看了看资源文件夹下的文件,都是PNG格式结尾的.在网上搜了一通后在stackoverflow上发现了一个帖子说:不要光看文件名是*.png结尾的,而