GithubHelp home page GithubHelp logo

Comments (3)

YuanGongND avatar YuanGongND commented on July 17, 2024 1

It seems that your are using audio_model.mlp_heads rather than audio_model.module.mlp_heads for classification, which indicates your audio_model is not an torch.nn.dataparallel object, if so, not only your mlp_heads, but also all other parts of AST model should not in the audio_model.module dict but the audio_model dict.

One thing you could try is setting strict=True when you load the model and see how it says.

from ast.

YuanGongND avatar YuanGongND commented on July 17, 2024

Hi there,

I am not sure if it is a training/test mismatch or model loading issue. Are you using our code and get TEST mAPs every epoch during training? And that doesn't match with the test mAP if you load the model and do inference separately? If that is the case, is there a difference in data loading (especially the norm stats) in these two processes?

Or you only get mAP on the training set during training, and that doesn't match with the test mAP? I think it is normal that the training/test mAPs are different.

I didn't see an issue with your model loading if you also save your model as dataparallel object.

-Yuan

from ast.

hbellafkir avatar hbellafkir commented on July 17, 2024

this issue was solved by initializing the mlp head correctly using:

with torch.no_grad():
                self.mlp_head[0].weight = nn.Parameter(sd["module.mlp_head.0.weight"])
                self.mlp_head[0].bias = nn.Parameter(sd["module.mlp_head.0.bias"])
                self.mlp_head[1].weight = nn.Parameter(sd["module.mlp_head.1.weight"])
                self.mlp_head[1].bias = nn.Parameter(sd["module.mlp_head.1.bias"])

from ast.

Related Issues (20)

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.