gpt4 book ai didi

python - 重新训练初始时,Tensorflow 无法创建新的可写文件

转载 作者:可可西里 更新时间:2023-11-01 14:14:21 27 4
gpt4 key购买 nike

我正在学习本教程:https://codelabs.developers.google.com/codelabs/tensorflow-for-poets/?utm_campaign=chrome_series_machinelearning_063016&utm_source=gdev&utm_medium=yt-desc#4

我正在运行这部分代码:

python retrain.py \
--bottleneck_dir=bottlenecks \
--how_many_training_steps=500 \
--model_dir=inception \
--summaries_dir=training_summaries/basic \
--output_graph=retrained_graph.pb \
--output_labels=retrained_labels.txt \
--image_dir=flower_photos

这是我在找到图像后遇到的错误,制造了一堆瓶颈并进行了步骤训练。

Traceback (most recent call last):
File "retrain.py", line 1062, in <module>
tf.app.run(main=main, argv=[sys.argv[0]] + unparsed)
File "C:\Anaconda3\lib\site-packages\tensorflow\python\platform\app.py", line 48, in run
_sys.exit(main(_sys.argv[:1] + flags_passthrough))
File "retrain.py", line 905, in main
f.write('\n'.join(image_lists.keys()) + '\n')
File "C:\Anaconda3\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 101, in write
self._prewrite_check()
File "C:\Anaconda3\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 87, in _prewrite_check
compat.as_bytes(self.__name), compat.as_bytes(self.__mode), status)
File "C:\Anaconda3\lib\contextlib.py", line 66, in __exit__
next(self.gen)
File "C:\Anaconda3\lib\site-packages\tensorflow\python\framework\errors_impl.py", line 466, in raise_exception_on_not_ok_status
pywrap_tensorflow.TF_GetCode(status))
tensorflow.python.framework.errors_impl.NotFoundError: Failed to create a NewWriteableFile: /tmp/output_labels.txt : The system cannot find the path specified.

你可以在这里找到我所有的代码: https://github.com/officialgupta/MachineLearningRecipes

谢谢

最佳答案

我也发现了一些类似的错误。如果我理解,您需要为 --output_graph--output_labels 设置绝对路径。

例如:

--output_graph=/home/%your_homhttps://stackoverflow.com/review/late-answers/17020426#e_user_name_folder%/Inception_retrained_graph.pb 
--output_labels=/home/%your_home_user_name_folder%/Inception_retrained_labels.txt

关于python - 重新训练初始时,Tensorflow 无法创建新的可写文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45076911/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com