fastnlp / fitlog Goto Github PK
View Code? Open in Web Editor NEWfitlog是一款在深度学习训练中用于辅助用户记录日志和管理代码的工具
Home Page: https://gitee.com/fastnlp/fitlog
License: Apache License 2.0
fitlog是一款在深度学习训练中用于辅助用户记录日志和管理代码的工具
Home Page: https://gitee.com/fastnlp/fitlog
License: Apache License 2.0
我在windows下的anaconda 中安装了fitlog。
fitlog init example初始化时报错
错误信息:
'cp' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
fitlog.add_metric({"dev": {"Acc": acc}}, step=step)
如果只有这一行,则不能用compare对比两次实验的acc曲线,会显示No overlapped metric to compare.
必须是下面的
fitlog.add_metric({"dev": {"Acc": acc}}, step=step)
fitlog.add_best_metric({"dev":{"Acc":best_acc}})
才能有对比界面
目前只能显示单个log的不同metric,实际上往往需要显示同一metric在不同log下对比,请问如何操作?
经常遇到很多个人用同一份code的不同branch在不同的机器上同时进行不同实验的情况,fitlog有没有打算加入合并多个project实验结果的功能?这样可以把大家的log合并在一起观察结果。
你好,首先感谢fitlog。
今天我在使用fitlog的时候,发现了一个问题,可能是当我的实验记录条数(401条)过多,在打开网页的时候,会弹窗报错Some error happens when initialize table。
系统:win10,fitlog版本已经更新到最新。
请问应该如何解决这一问题?
期待您的回复。
如题.
您好:
我在代码起始位置加入fitlog.commit(file)后,按照fitlog revert xxx的方式回退代码,提升 Your code is reverted to /data/yubowen/experiments/NA_revert,但是在NA_revert文件夹中并没有代码,请问是什么问题呢?
现在在启动网页端server之后redirect的路径时直接使用了绝对路径,如http://xxxx/table,而不是http://xxxx:pp/table,但是如果是在服务器上或者docker环境下使用就会出问题,暴露出的端口只能在第一次GET请求时成功,后续的网页资源由于路径原因全部无法使用。
是否可以有个选项直接使用.git做版本管理,不用.fitlog,这样更加简单一些,我也可以将logs和.fitconfig这些文件一起添加到git上去,如果放在.fitlog中不能提交到git上去,后面如果丢失,实验记录就丢了
试了添加参数--ip --port都没用,但是本地可以打开,请问有什么解决办法吗
在有跳板机的服务器上如何获取fitlog log服务?
我尝试在跳板机位置开启服务,但仍无法在本地通过 ”远程服务器地址:5000“ 链接到服务
您好,我在使用fitlog中产生了一些疑问,烦请解答:
谢谢!
我的程序是多线程的,请问
我可以同时记录几个训练过程吗?
内部有锁吗?我可以在不同的线程log吗?
(PS:关键部分释放了gil所以没有性能问题,因为内存不够所以我想不同超参数的训练可以共享内存,多线程共享内存比较方便。)
fitlog管理的git是否会和外部的git冲突?
我尝试在服务器上安装fitlog, 但出现如下错误:
(venv-torch) zhy@node27:~$ pip install git+https://gitee.com/fastnlp/fitlog
Collecting git+https://gitee.com/fastnlp/fitlog
Cloning https://gitee.com/fastnlp/fitlog to /tmp/pip-req-build-gdyvazpp
Running command git clone -q https://gitee.com/fastnlp/fitlog /tmp/pip-req-build-gdyvazpp
ERROR: Package 'fitlog' requires a different Python: 3.5.2 not in '>=3.6'
WARNING: You are using pip version 19.3.1; however, version 20.3.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
“直接在入口代码处加入fitlog.debug() ”,“入口代码处”指的是什么?
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?
Reach the root or home.
Can not find the config file.
Traceback (most recent call last):
File "train_presum.py", line 22, in
fitlog.commit('file')
File "/root/miniconda3/envs/myconda/lib/python3.8/site-packages/fitlog-0.9.13-py3.8.egg/fitlog/init.py", line 95, in commit
_logger.commit(file, fit_msg)
File "/root/miniconda3/envs/myconda/lib/python3.8/site-packages/fitlog-0.9.13-py3.8.egg/fitlog/fastlog/logger.py", line 32, in wrapper
return func(*args, **kwargs)
File "/root/miniconda3/envs/myconda/lib/python3.8/site-packages/fitlog-0.9.13-py3.8.egg/fitlog/fastlog/logger.py", line 142, in commit
raise RuntimeError("It seems like you are not running under a folder governed by fitlog.\n" + msg['msg'])
RuntimeError: It seems like you are not running under a folder governed by fitlog.
Error: Config file is not found
1.是否只要入口函数(比如main.py)里有一个fitlog.commit(file)就可以了,其他文件中不需要?
2.如果一个任务里有两个子任务,需要两个不同的入口函数(main_taskA.py, main_taskB.py),是否每个main里都应该有个fitlog.commit(file)?
3.我想学学你们是怎么操作git自动commit的。通常用gitpython这个库可以操作git,但你们好像没有用到。
您好,我看到源码中是在create_log_files()里定义了logging的级别,请问是否支持用户再次自定义这一级别呢?因为我不太希望在训练过程中出现很多行loss,因为tqdm已经可以满足这一需求。
谢谢!
您好,
你们的项目正是我现在需要的日志管理文件,我刚开始使用,非常便利美观。
为了节省时间,通常分开跑不同参数的训练脚本,在同时运行的两个脚本中我调用了figlog,分别创造了两个文件夹(对应前端的两行),我发现刷新浏览器页面之后,hyper会变得奇怪丢失了一些项目,尝试在上方的列选项中重新勾选,发现也不见了一些项目。
目前的解决方法是,使用你们页面上的刷新而不是浏览器的刷新,并且无法对metric使用对比按钮。
是否是我操作错误?
期待你们以后的更新~
如题,请问目前的版本支持吗?因为想把存放model的文件夹命名成和log id一致的名字,方便查找。非常感谢!
如题
1e-6会显示为0.000001,1e-7以下时开始会显示1e-7、1e-8,刷新web界面后就会变成0
用网页上的刷新键刷新没问题,但是用F5刷新后,自己添加的memo就没了
环境:win10 wsl ubuntu20.4 python3.7
fitlog init报权限问题,再执行一次提示成功
Traceback (most recent call last):
File "/mnt/d/Ubuntu/miniconda3/envs/test/bin/fitlog", line 8, in
sys.exit(main_cmd())
File "/mnt/d/Ubuntu/miniconda3/envs/test/lib/python3.7/site-packages/fitlog/fastcmd/init.py", line 49, in main_cmd
cmd_mapcmd
File "/mnt/d/Ubuntu/miniconda3/envs/test/lib/python3.7/site-packages/fitlog/fastcmd/init_cmd.py", line 26, in init_cmd
committer.init_project(name, hide=args["--hide"], git=not args["--no-git"])
File "/mnt/d/Ubuntu/miniconda3/envs/test/lib/python3.7/site-packages/fitlog/fastgit/committer.py", line 504, in init_project
shutil.copytree(os.path.join(tools_path, "logs"), os.path.join(pj_path, "logs"))
File "/mnt/d/Ubuntu/miniconda3/envs/test/lib/python3.7/shutil.py", line 368, in copytree
raise Error(errors)
shutil.Error: [('/mnt/d/Ubuntu/miniconda3/envs/test/lib/python3.7/site-packages/fitlog/fastgit/normal/logs', '/mnt/d/Github/extest/logs', "[Errno 13] Permission denied: '/mnt/d/Github/extest/logs'")]
查看完一组实验的曲线再返回主界面。 包括save在内的一系列按钮不见了。同时delete和erase按键也不起任何作用
fitlog log logs运行正常,但是 http://0.0.0.0:5000/ 打不开,指定其他端口也没用,请问可能是什么原因呢?有可能是这个吗 https://www.cnblogs.com/squirrel2300/p/6925446.html
比如我现在有个超参数alpha想从[1, 2...,10]中搜索,我写了一个for循环给我的算法传参数
for alpha in range(1, 11):
fitlog.add_hyper(alpha, 'alpha')
train(..., alpha)
`
在web页面里我发现下一个循环的数值会替换上一次的,没有办法得到10个值的结果。
When I followed the tutorial of fitlog, I met a bug at step3.
After I typed "fitlog log logs", I came across an error
"UnicodeDecodeError: 'gbk' codec can't decode byte 0xaa in position 36: illegal multibyte sequence"
at
"../fitlog/fastserver/server/log_config_parser.py", line 1042, in _read
for lineno, line in enumerate(fp, start=1):
So I modified the encoding at line 682.
Is there any better solution?
dev 分支是我们最新的开发进展,欢迎大家提交 PR。
在已存在的git仓库内部, 执行fitlog init 会报错。提示如下:
`$ fitlog init
Traceback (most recent call last):
File "/Users/zhou/miniconda3/lib/python3.7/shutil.py", line 566, in move
os.rename(src, real_dst)
FileNotFoundError: [Errno 2] No such file or directory: '/Users/zhou/example/.fitlog' -> '/Users/zhou/example/.git'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/zhou/miniconda3/bin/fitlog", line 8, in
sys.exit(main_cmd())
File "/Users/zhou/miniconda3/lib/python3.7/site-packages/fitlog/fastcmd/init.py", line 49, in main_cmd
cmd_mapcmd
File "/Users/zhou/miniconda3/lib/python3.7/site-packages/fitlog/fastcmd/init_cmd.py", line 26, in init_cmd
committer.init_project(name, hide=args["--hide"], git=not args["--no-git"])
File "/Users/zhou/miniconda3/lib/python3.7/site-packages/fitlog/fastgit/committer.py", line 496, in init_project
self._switch_to_fast_git(pj_path)
File "/Users/zhou/miniconda3/lib/python3.7/site-packages/fitlog/fastgit/committer.py", line 167, in _switch_to_fast_git
shutil.move(fitlog_path, git_path)
File "/Users/zhou/miniconda3/lib/python3.7/shutil.py", line 580, in move
copy_function(src, real_dst)
File "/Users/zhou/miniconda3/lib/python3.7/shutil.py", line 266, in copy2
copyfile(src, dst, follow_symlinks=follow_symlinks)
File "/Users/zhou/miniconda3/lib/python3.7/shutil.py", line 120, in copyfile
with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: '/Users/zhou/example/.fitlog'`
希望能修复。十分感谢!
能否只让它收集loss, 参数等信息.
我尝试不使用fitlog.commit(file), 但依然无法使用, 会报 ImportError: Failed to initialize: Bad git executable.
好像是导入包时就会判断是否有git.
我有时看看如果不收敛就暂停一半就不跑了,但是我也需要记录log。
在网页端是否可以显示实时的loss变化曲线然后每隔多少秒自己刷新一次
比如在config里指定dropout = [0.1, 0.2, 0.3]
在代码里使用dropout = fitlog.config['dropout']
然后执行代码,自动执行三次试验,无需手动写循环,或者每次手动改变参数
您好:
网页界面上对fit_msg、git_msg和memo进行edit后提示update successfully,但是刷新网页后还是edit之前的状态,有什么特殊操作需要进行么?
目前的可视化只有loss和metric能否添加上lr的可视化,这样可以清晰的记录lr schedule
你好,最近我想使用argparse模块和fitlog来进行调参实验,但是发现log日志中hyper.log内容显示的不对。
`
parser = argparse.ArgumentParser(description='Hyper Parameters For Traning')
parser.add_argument('-city', type=str, default='lishui', help='select dataset')
parser.add_argument('-nrnn', type=int, default=128, help='Hidden Dimension')
parser.add_argument('-nmlp', type=int, default=128, help='number of hidden size of MLP')
# parser.add_argument('-nlayers', type=int, default=1, help='Number of layers for RNN')
parser.add_argument('-epoch', type=int, default=1000, help='training epoch')
parser.add_argument('-batch', type=int, default=1024, help='Batch Size')
parser.add_argument('-lr', type=float, default=0.001, help='learning rate')
opt = parser.parse_args()
print(opt)
rand_seed = 123
patience = 50
######hyper
city = opt.city
hidden_size_rnn = opt.nrnn
hidden_size_mlp = opt.nmlp
batch_size = opt.batch
lr = opt.lr
max_epoch = opt.epoch
dropouts = None
######hyper`
例如上面代码所示,我通过命令行传入参数,并通过argparse解析传给主程序,并用fitlog的hyper parameter方式记录超参数。
结果在hyper.log中的内容为:
{"hyper": {"city": "opt.city", "hidden_size_rnn": "opt.nrnn", "hidden_size_mlp": "opt.nmlp", "batch_size": "opt.batch", "lr": "opt.lr", "max_epoch": "opt.epoch", "dropouts": "None"}}
fitlog只是简单把 '='前后的内容变成key和value,而没有解析出具体的值
工具非常赞,提高了我的调参效率
想请问是否可以直接在网页上查看fitlog.commit的代码版本变动?如果目前工具不支持的话,有什么方案可以推荐吗?
比较好奇,多进程还是挺需要的,特别是搜参数的时候
首先感谢作者,fitlig真的很好用,下面是我在使用中遇到的一个小bug。
当我使用argsparse传入列表参数时:
parser.add_argument("--hidden_dim",type=int,nargs='+')
此时type(args.hidden_dim)是list,但是执行fitlog.add_hyper(args)后,type(args.hidden_dim)为str,如果此时将次参数传入模型会造成错误。虽然这个bug可以规避,但是感觉也算是个小问题。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.