TensorFlow報AttributeError: module tensorflow has no attribute io

錯誤描述

在使用TensorFlow的models參考的代碼訓練目標檢測模型時候報AttributeError: module 'tensorflow' has no attribute 'io'錯誤,錯誤是由下面的代碼導致的

with tf.io.gfile.GFile(path, 'r') as fid:

python版本:3.6.10

TensorFlow版本:1.8.0

解決辦法

因爲TensorFlow版本的升級對接口做了調整,將上面的代碼改成下面的行

with tf.gfile.GFile(path, 'r') as fid:

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章