Comments (5)
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.
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.
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.
I see. Please refer to #4.
from sptnet.
Thanks for your valuable reply. I will try to obtain the pretrained SimGCD model
from sptnet.
Related Issues (9)
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 sptnet.