Comments (6)
需要修改训练部分的代码,目前的代码并不支持再训练。
from e2e-coref-pytorch.
非常抱歉,这么晚才回复你,是因为最近我才刚跑成功。
请问一下,训练部分需要修改哪些地方,希望得到你的指点,十分感谢!
祝好!
from e2e-coref-pytorch.
主要需要在模型初始化后增加模型/优化器加载模块,调整学习率等参数。其他一些细节的代码也可能要按需修改。
from e2e-coref-pytorch.
感谢你的回复,按照你说的,我在初始化模型后添加了模型/优化器加载模块,如下所示:
`coref_model = model.CorefModel(c).to(c["device"])
optimizer = torch.optim.Adam(coref_model.parameters(), lr=c["lr"], weight_decay=c["weight_decay"])
if os.path.exists(c["checkpoint_path"] + ".max"):
print("loading model from checkpoint...")
checkpoint = torch.load(c["checkpoint_path"] + ".max", map_location=c["device"])
coref_model.load_state_dict(checkpoint["model"])
optimizer.load_state_dict(checkpoint["optimizer"])`
学习率好像一直都是0.0002,没有变。
在保存模型的时候需要添加什么吗?
感谢!
祝好!
from e2e-coref-pytorch.
大体方向是对的,但transformer模型也需要加载。保存模型的时候注意一下保存路径。如果运行过程出错,其他部分细节上可能也会有要修改的。
from e2e-coref-pytorch.
谢谢大佬,感谢你的回复!
祝好!
from e2e-coref-pytorch.
Related Issues (13)
- ERROR: could not find a version that satisfies the requirement torch==1.15.0 HOT 1
- loss直接降为0的问题 HOT 7
- 训练停不下来 HOT 2
- CUDA out of memory HOT 3
- 请问可以提供训练好的模型文件吗 HOT 2
- train 发生错误 HOT 1
- 哥,这个配上ontonotes5.0就可以跑了吗 HOT 2
- 数据预处理 HOT 4
- 英文效果不好 HOT 14
- 运行报错 HOT 7
- ”top_span_ratio“指的是什么 HOT 1
- help HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from e2e-coref-pytorch.