Skip to content

Instantly share code, notes, and snippets.

@parajain
Last active October 1, 2018 06:54
Show Gist options
  • Save parajain/e0cbcb108a98f4e3e39a4f6d44a4cf7c to your computer and use it in GitHub Desktop.
Save parajain/e0cbcb108a98f4e3e39a4f6d44a4cf7c to your computer and use it in GitHub Desktop.
Example to print flag as key,values. So that can be saved as json.
'''
Example to print flag as key,values. So that can be saved as json.
tf version '1.10.0'
'''
import tensorflow as tf
tf.app.flags.DEFINE_string('source_vocabulary', 'data/europarl-v7.1.4M.de.json', 'Path to source vocabulary')
tf.app.flags.DEFINE_string('target_vocabulary', 'data/europarl-v7.1.4M.fr.json', 'Path to target vocabulary')
FLAGS = tf.app.flags.FLAGS
print("\nParameters:")
for attr, value in sorted(FLAGS.__flags.items()):
print("{}={}".format(attr.upper(), value.value))
print("")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment