TensorFlow番外篇——module 'tensorflow' has no attribute 'xxx'

来源:互联网 发布:柯林斯 知乎 编辑:程序博客网 时间:2024/06/11 12:08

对着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()
阅读全文
2 0
原创粉丝点击