錯誤描述
在使用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: