什么train_dir用于Tensorflow imagenet_train从头开始训练?

时间:2017-05-11 08:40:28

标签: python tensorflow deep-learning imagenet

我正在关注以下页面

https://github.com/tensorflow/models/tree/master/inception

我到了必须要跑的地步:

bazel-bin/inception/imagenet_train --num_gpus=1 --batch_size=32 --train_dir=/tmp/imagenet_train --data_dir=/tmp/imagenet_data

然而,我得到了以下错误:

Traceback (most recent call last):
  File "/home/demo/anaconda3/envs/tensorflow/models/inception/bazel-bin/inception/imagenet_train.runfiles/inception/inception/imagenet_train.py", line 41, in <module>
    tf.app.run()
  File "/home/demo/anaconda3/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "/home/demo/anaconda3/envs/tensorflow/models/inception/bazel-bin/inception/imagenet_train.runfiles/inception/inception/imagenet_train.py", line 35, in main
    tf.gfile.DeleteRecursively(FLAGS.train_dir)
  File "/home/demo/anaconda3/envs/tensorflow/lib/python2.7/site-packages/tensorflow/python/lib/io/file_io.py", line 420, in delete_recursively
    pywrap_tensorflow.DeleteRecursively(compat.as_bytes(dirname), status)
  File "/home/demo/anaconda3/envs/tensorflow/lib/python2.7/contextlib.py", line 24, in __exit__
    self.gen.next()
  File "/home/demo/anaconda3/envs/tensorflow/lib/python2.7/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.FailedPreconditionError: /tmp/imagenet_train

我的DATA_DIR距上一步/tmp/imagenet_data

bazel-bin/inception/download_and_preprocess_imagenet "${DATA_DIR}"

但是我的train_dir是什么?医生没有提到它吗?看起来像一个空文件夹不正确。

2 个答案:

答案 0 :(得分:1)

对我来说,如果我设置了--train_dir = / tmp的路径,它就有效。此外,您在同一目录中具有已处理的数据集。 --train_dir和--data_dir不应该相互重合。

放置ImageNet数据的位置DATA_DIR = $ HOME / imagenet-data

如果您在更改目录后仍遇到问题,能否告诉我?

答案 1 :(得分:0)

--train_dir是一个空目录的路径,其中模型检查点和事件文件在模型被训练时存储。