def restore_config(config_file): with open(config_file) as f: flags = pickle.load(f) for k, v in flags.iteritems(): setattr(FLAGS, k, v)