tensorflow中的tensorflow.python.framework.errors_impl.NotFoundError 錯誤及解決方法

在使用tensorflow是,出現tensorflow.python.framework.errors_impl.NotFoundError錯誤

python extract_features.py --config_file=/model/chinese/config.json 

報錯如下:

tensorflow.python.framework.errors_impl.NotFoundError: /model/chinese/config.json; No such file or directory(Lunix系統)

tensorflow.python.framework.errors_impl.InvalidArgumentError: Unsuccessful TensorSliceReader constructor: Failed to get matching files on /model/chinese/config.json: Not found: FindFirstFile failed for: /model/chinese : ϵͳ\udcd5Ҳ\udcbb\udcb5\udcbdָ\udcb6\udca8\udcb5\udcc4·\udcbe\udcb6\udca1\udca3
--config_file=/model/chinese/config.json(win10系統下)

 

究其原因,是因爲路徑問題,--config_file 給出的路徑是錯誤的,在lunix下執行 

ls /model/chinese/

報錯:ls: cannot access '/model/chinese/': No such file or directory

執行

ls ./model/chinese/

則正確輸出目錄下的文件。這說明之前參數中的路徑 /model/chinese/ 的路徑是錯誤的,而 ./model/chinese/ 纔是正確的路徑

python extract_features.py --config_file=./model/chinese/config.json 

正常運行,沒有在報 tensorflow.python.framework.errors_impl.NotFoundError 錯誤

參考:https://stackoverflow.com/questions/42928822/tensorflow-python-framework-errors-impl-notfounderror-while-creating-a-custom-in

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