GithubHelp home page GithubHelp logo

the pretrained model weights about sptnet HOT 5 CLOSED

llj110 avatar llj110 commented on August 28, 2024
the pretrained model weights

from sptnet.

Comments (5)

whj363636 avatar whj363636 commented on August 28, 2024

Hi @llj110

Thanks for your interest. The backbone and projector components have been wrapped in a Sequential module called "classifier," while the prompter and classifier are further grouped within another Sequential module called 'model'. Therefore, if your intention is to solely reload the weights for the 'classifier' component, rather than the entire 'model', in both train.py and eval.py, you can maintain the code and simply select the last module from the pretrained model. This module contains the full weights of the backbone and projector.

from sptnet.

llj110 avatar llj110 commented on August 28, 2024

classifier = nn.Sequential(backbone, projector).cuda()
state_dict = torch.load(args.pretrained_model_path, map_location='cpu')
classifier.load_state_dict(state_dict)
Thanks for your reply. My question is how to load the pretrained model parameters for the classifier using dino_vitbase16_pretrain.pth. The model I downloaded can only load the backbone parameters, but the parameters for the DINOHead cannot be loaded. This issue persists even when I use dino_vitbase16_pretrain_full_checkpoint.pth, which contains the weights for both the backbone and the projector head.

from sptnet.

llj110 avatar llj110 commented on August 28, 2024

I can just run this code by adjust the code to
state_dict = torch.load(args.pretrained_model_path, map_location='cpu')
backbone.load_state_dict(state_dict)
classifier = nn.Sequential(backbone, projector).cuda(). Therefore, I would like to ask if it is possible to provide the pretrained weights for the classifier.

from sptnet.

whj363636 avatar whj363636 commented on August 28, 2024

I see. Please refer to #4.

from sptnet.

llj110 avatar llj110 commented on August 28, 2024

Thanks for your valuable reply. I will try to obtain the pretrained SimGCD model

from sptnet.

Related Issues (9)

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.