def save_run(config, environment=None, comment=None, extra_config=None,
base_path=DEFAULT_BASE_PATH, filename=DEFAULT_FILENAME):
if environment == 'cloud':
# We don't write runs inside Google Cloud, we run it before.
return
diff = get_diff()
lumi_version = get_luminoth_version()
tf_version = get_tensorflow_version()
experiment = {
'environment': environment,
'datetime': str(datetime.datetime.utcnow()) + 'Z',
'diff': diff,
'luminoth_version': lumi_version,
'tensorflow_version': tf_version,
'config': config,
'extra_config': extra_config,
}
file_path = os.path.join(base_path, filename)
tf.gfile.MakeDirs(base_path)
with tf.gfile.Open(file_path, 'a') as log:
log.write(json.dumps(experiment) + '\n')
评论列表
文章目录