experiments.py 文件源码

python
阅读 36 收藏 0 点赞 0 评论 0

项目:luminoth 作者: tryolabs 项目源码 文件源码
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')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号