fastnlp / fitlog

fitlog是一款在深度学习训练中用于辅助用户记录日志和管理代码的工具

Home Page:https://gitee.com/fastnlp/fitlog

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error when not employing the commit API

BebDong opened this issue · comments

Hello, thanks for providing this wonderful tool.

When I use the tutorial codes in https://fitlog.readthedocs.io/zh/latest/user/quickstart.html and comment out the commit function, it goes wrong.

import fitlog
import random

fitlog.commit(__file__)  # auto commit your codes
fitlog.add_hyper_in_file(__file__)  # record your hyperparameters
######hyper
rand_seed = 12
######hyper
random.seed(rand_seed)
best_acc, best_step, step = 0, 0, 0

for i in range(200):
    step += 1
    if step % 20 == 0:
        loss = random.random()
        acc = random.random()
        fitlog.add_loss(loss, name="Loss", step=step)
        fitlog.add_metric(acc, name="Acc", step=step)
    if step % 100 == 0:
        test_acc = random.random()
        if test_acc > best_acc:
            best_acc = test_acc
            best_step = step
fitlog.add_best_metric({"Test": {"Acc": best_acc, "Step": best_step}})
fitlog.finish()  # finish the logging

Error information is as below,
image

Is it necessary to use the COMMIT API?

commented

No, commit is not needed. set_log_dir() is enough to record experiment results.

@yhcc Thanks!