TensorFlow报错—module 'tensorflow' has no attribute 'xxx'(转载)

对着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

猜你喜欢

转载自blog.csdn.net/m0_37407756/article/details/80826663