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

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里安装的很简单,执行如下步骤即可:
在这里插入图片描述