Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem when trying to finetune a model, using resnet50 backbone #251

Open
saeidrazavi opened this issue Sep 8, 2023 · 1 comment
Open

Comments

@saeidrazavi
Copy link

when i try to fine-tune pre_trained model (using full ckpt) with a different dataset using following command :

!python "main_dino.py" --arch resnet50 --batch_size_per_gpu 32 --epochs=20 --data_path "/content/dataset/train" --output_dir "/content/model_checkpts"

i got this error :

size mismatch for module.head.mlp.0.weight: copying a param with shape torch.Size([4096, 2048]) from checkpoint, the shape in current model is torch.Size([2048, 2048]).
size mismatch for module.head.mlp.0.bias: copying a param with shape torch.Size([4096]) from checkpoint, the shape in current model is torch.Size([2048]).

can someone explain me the problem?
i think the problem is that full_ckpt file, does not contain full weights of mlp heads and it's kinda incomplete

@Badar-e-Alam
Copy link

Because you have a checkpoint in output_dir which will be loaded by utils.restart_from_checkpoint , another hint is you use the arch as resent50 it's also have the Dino_head and MultiCropWrapper warp around look line 133.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants