Commit 6601008f authored by Henry-E's avatar Henry-E Committed by GitHub
Browse files

ensure output directory exists

The neural programmer model fails the first time it's run, if the output directory folder does not already exist. In this case "../model" does not exist and the function fails because the mkdir function doesn't appear to create parent folders. 
Error: 
tensorflow.python.framework.errors_impl.NotFoundError: ../model//modeltemp/
parent 2fa6057a
...@@ -195,6 +195,9 @@ def master(train_data, dev_data, utility): ...@@ -195,6 +195,9 @@ def master(train_data, dev_data, utility):
else: else:
ckpt = tf.train.get_checkpoint_state(model_dir) ckpt = tf.train.get_checkpoint_state(model_dir)
print "model dir: ", model_dir print "model dir: ", model_dir
if (not (tf.gfile.IsDirectory(utility.FLAGS.output_dir))):
print "create dir: ", utility.FLAGS.output_dir
tf.gfile.MkDir(utility.FLAGS.output_dir)
if (not (tf.gfile.IsDirectory(model_dir))): if (not (tf.gfile.IsDirectory(model_dir))):
print "create dir: ", model_dir print "create dir: ", model_dir
tf.gfile.MkDir(model_dir) tf.gfile.MkDir(model_dir)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment