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

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