We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
when i run main.py,it‘s appear ’NameError: name 'math' is not defined‘, the main.py code as fllowing
import fitlog import random import argparse
parser = argparse.ArgumentParser() parser.add_argument('--demo', type=int, default=2)
fitlog.set_log_dir("logs/") # 设定日志存储的目录
args = parser.parse_args() fitlog.add_hyper(args) # 通过这种方式记录ArgumentParser的参数 fitlog.add_hyper_in_file(file) # 记录本文件中写死的超参数
######hyper rand_seed = 12345 ######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({"dev":{"Acc":acc}}, step=step) if acc>best_acc: best_acc = acc fitlog.add_best_metric({"dev":{"Acc":best_acc}}) # 当dev取得更好的performance就在test上evaluate一下 test_acc = random.random() fitlog.add_best_metric({"test":{"Acc":test_acc}}) fitlog.finish() # finish the logging
The text was updated successfully, but these errors were encountered:
用pip安装最新版本的,或者定位到报错文件 加上 import math 就可以了
Sorry, something went wrong.
No branches or pull requests
when i run main.py,it‘s appear ’NameError: name 'math' is not defined‘, the main.py code as fllowing
import fitlog
import random
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--demo', type=int, default=2)
fitlog.set_log_dir("logs/") # 设定日志存储的目录
args = parser.parse_args()
fitlog.add_hyper(args) # 通过这种方式记录ArgumentParser的参数
fitlog.add_hyper_in_file(file) # 记录本文件中写死的超参数
######hyper
rand_seed = 12345
######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({"dev":{"Acc":acc}}, step=step)
if acc>best_acc:
best_acc = acc
fitlog.add_best_metric({"dev":{"Acc":best_acc}})
# 当dev取得更好的performance就在test上evaluate一下
test_acc = random.random()
fitlog.add_best_metric({"test":{"Acc":test_acc}})
fitlog.finish() # finish the logging
The text was updated successfully, but these errors were encountered: