问题来源
将一个ndarray格式的图片转换为PIL.Image的时候一直提示type object ‘Image’ has no attribute ‘fromarray’。通过检查PIL.Image发现,该类并不含有官方文档所说的fromarray函数
解决方案
重新安装Pillow,就能在函数库搜索到fromarray函数
pip uninstall Pillow
pip install Pillow==7.1.2
将一个ndarray格式的图片转换为PIL.Image的时候一直提示type object ‘Image’ has no attribute ‘fromarray’。通过检查PIL.Image发现,该类并不含有官方文档所说的fromarray函数
重新安装Pillow,就能在函数库搜索到fromarray函数
pip uninstall Pillow
pip install Pillow==7.1.2
繼續運行 ?* 回憶上次內容 上次使用shell環境中的命令 命令 作用 c