I have some tensorflow code that contains tensorflow flags written as below:
from tensorflow.python.platform import flags
FLAGS = flags.FLAGS
## Logging, saving, and testing options
flags.DEFINE_bool('log', True, 'if false, do not log summaries, for debugging code.')
flags.DEFINE_string('logdir', 'trained_mdl/', 'directory for summaries and checkpoints.')
flags.DEFINE_bool('resume', True, 'resume training if there is a model available')
flags.DEFINE_bool('train', False, 'True to train, False to test.')
flags.DEFINE_integer('test_iter', -1, 'iteration to load model (-1 for latest model)')
flags.DEFINE_bool('test_set', True, 'Set to true to test on the the test set, False for the validation set.')
flags.DEFINE_integer('train_update_batch_size', -1, 'number of examples used for gradient update during training (use if you want to test with a different number).')
flags.DEFINE_float('train_update_lr', -1, 'value of inner gradient step step during training. (use if you want to test with a different value)') # 0.1 for omniglot
I want to do several runs, and for that, I wrote a bash script as follows:
#!/usr/bin/env bash
python main.py
--meta_batch_size 8
--train True
--test_set False
> main1_train.txt
But it starts over then never executes. Does bash with tensorflow flags do not work at all ? If that then I have no other option that using argparse
instead of FLAGS
?
Update 1
I am getting the following error:
run_main1.sh: line 5: --meta_batch_size: command not found
run_main1.sh: line 6: --train: command not found
run_main1.sh: line 7: --test_set: command not found