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

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/PinkRiverside/article/details/72860178

对着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()
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章