Git Product home page Git Product logo

Comments (6)

cheniison avatar cheniison commented on August 11, 2024

需要修改训练部分的代码,目前的代码并不支持再训练。

from e2e-coref-pytorch.

Bigchen8013 avatar Bigchen8013 commented on August 11, 2024

非常抱歉,这么晚才回复你,是因为最近我才刚跑成功。
请问一下,训练部分需要修改哪些地方,希望得到你的指点,十分感谢!

祝好!

from e2e-coref-pytorch.

cheniison avatar cheniison commented on August 11, 2024

主要需要在模型初始化后增加模型/优化器加载模块,调整学习率等参数。其他一些细节的代码也可能要按需修改。

from e2e-coref-pytorch.

Bigchen8013 avatar Bigchen8013 commented on August 11, 2024

感谢你的回复,按照你说的,我在初始化模型后添加了模型/优化器加载模块,如下所示:
`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.

cheniison avatar cheniison commented on August 11, 2024

大体方向是对的,但transformer模型也需要加载。保存模型的时候注意一下保存路径。如果运行过程出错,其他部分细节上可能也会有要修改的。

from e2e-coref-pytorch.

Bigchen8013 avatar Bigchen8013 commented on August 11, 2024

谢谢大佬,感谢你的回复!

祝好!

from e2e-coref-pytorch.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.