Giter VIP home page Giter VIP logo

Comments (1)

frankaging avatar frankaging commented on July 30, 2024

Hi,
Thanks for your comments. I believe the reason is about the variable namings.

If you look at this line of code in the training set-up https://github.com/frankaging/Quasi-Attention-ABSA/blob/main/code/util/train_helper.py#L300,
model.bert.load_state_dict(torch.load(init_checkpoint, map_location='cpu'), strict=False)
this load_state_dict will load parameters based on names. I think, with the current code, the HuggingFace model has different names for all variables in BERT. As a result, you are not loading any weights from the pre-trained BERT. You can check this by simply printing out weights before this line and after this line. And you will see what I am talking about, I think.

There are two solutions: (1) using the google one for pre-trained weights importing like what you are doing. (2) change the code to integrate with both models. The second approach will require you to modify the variable namings of the model.

Does this make sense?

from quasi-attention-absa.

Related Issues (6)

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.