AttributeError: module 'tensorflow' has no attribute 'truncated_normal'

BEGIN:

解决方案:更换更低版本(具体操作如下)

打开cmd,运行

pip list

查询结果如下,找到tensorflow我这里版本为2.0.0a0

 修改版本为1.5,执行如下命令

pip3 install tensorflow==1.5

结果

 有点问题,更新一下:

pip install update tensorflow

结果如下:

 用pip list查看一下,这时候版本为1.5.0:

这时候我这里出现了另一个隐藏的warning:

FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint8 = np.dtype([("qint8", np.int8, 1)])

更改numpy版本,我这里原先是1.17.0,改为1.16

pip3 install numpy==1.16

额……还是有问题,老办法

pip install update numpy

 最后

pip list

 好啦,问题解决了!

END.

猜你喜欢

转载自www.cnblogs.com/gangpei/p/12654191.html