2023.8.18
报错原因:scipy版本过高,在新版本的scipy上弃用了imread的函数
解决方案1:需要降低scipy的版本:pip install scipy==1.2.1
解决方案2:更换另外一种读取方式
pip install imageio
并更改代码如图:
但是,出现新报错:
AttributeError: module 'tensorflow' has no attribute 'Session'
这是tensorflow的问题,需要使用Tnesorflow1版本的操作,屏蔽tf2的操作
于是在代码开始写上: import tensorflow.compat.v1 as tf 完美解决!