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