对着TensorFlow中文社区的教程敲了一部分,最经常出现的错误就是
module 'tensorflow' has no attribute 'xxx'
原因是TensorFlow新版本修改了许多函数的名字,不完全整理如下:
tf.sub()
更改为tf.subtract()
tf.mul()
更改为tf.multiply()
tf.types.float32
更改为tf.float32
tf.pact()
更改为tf.stact()
问题:
AttributeError: module 'tensorflow' has no attribute 'float32'
我换了一下tensorflow的版本,gpu-1.7.0报的错。我换成了gpu-1.8.0可以了
转载:https://blog.csdn.net/pinkriverside/article/details/72860178