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