1. 程式人生 > >AttributeError: 'module' object has no attribute 'gfile'

AttributeError: 'module' object has no attribute 'gfile'

xbrl mct XA vts ctp svi mom bad ddr

While running TensorFlow‘s classify_image, getting AttributeError: ‘module‘ object has no attribute ‘gfile‘

當運行TensorFlow的classify_image時,得到錯誤提示“AttributeError: ‘module‘ object has no attribute ‘gfile‘”。

問題描述:

我得到一個錯誤,當我運行TensorFlow樣例文件時,在imagenet model下,

I am getting this error while running the sample file given with TensorFlow, in the imagenet model,

File "classify_image.py", line 154, in run_inference_on_image
if not tf.gfile.Exists(image):

AttributeError: ‘module‘ object has no attribute ‘gfile‘

I have tried installing using both, from pip as well as source, on virtualserver as well, still I get this error.

我已經嘗試安裝兩個方法了,從pip到source,在virtualserver等等,但是還是得到這個錯誤。

This gfile stuff was added 6 days ago in this commit -- github.com/tensorflow/tensorflow/commit/… , might be worth filing an issue on github. As a workaround, you can undo the gfile stuff locally back into os.path, it‘s only a few lines – Yaroslav Bulatov

這個gfile的東西是在6天前加上去的,看這個評論,github.com/tensorflow/tensorflow/commit/…

,或許值得在github上添加一個issue。作為一種解決方案,你可以本地撤銷gfile東西回到os.path。它只是幾行代碼而已。

技術分享圖片

AttributeError: 'module' object has no attribute 'gfile'