error when not employing the commit API
BebDong opened this issue · comments
BebDong commented
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,
Is it necessary to use the COMMIT API?
yhcc commented
No, commit is not needed. set_log_dir() is enough to record experiment results.