Reputation: 131
I would like to store FLAGS
(tf.app.flags.FLAGS
) in a file and reload them later. Until TensorFlow 1.4, I used this code for reloading:
with open(config_file, 'r') as f:
config = json.load(f)
FLAGS.__flags.update(config)
From TensorFlow 1.5, the underlying implementation of FLAGS
changed. Does anybody know a way to update the FLAGS with values stored in a file?
Upvotes: 0
Views: 776
Reputation: 31
Try:
with open(config_file, 'r') as f:
config = json.load(f)
for name, value in config.items():
FLAGS.__flags[name].value = value
Upvotes: 3