(Filenotfound.)

在使用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://blog.csdn.net/u014553172/article/details/89电脑889642


电脑