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

DINO Training with Swin-small #334

Open
ysysys666 opened this issue Jan 10, 2024 · 3 comments
Open

DINO Training with Swin-small #334

ysysys666 opened this issue Jan 10, 2024 · 3 comments

Comments

@ysysys666
Copy link

Dear author,
Hello.
I am now training dino, the swin-s chosen by the backbone. My configuration is the same as yours, 4gpus, but my batch_size is halved to 8, so the initial learning rate is halved, but the training results are all 0.
"d2.checkpoint.c2_model_loading WARNING: Shape of norm.weight in checkpoint is torch.Size([768]), while shape of necks.norm.weight in model is torch.Size([256]) "
"d2.checkpoint.c2_model_loading WARNING: Shape of norm.weight in checkpoint is torch.Size([768]), while shape of transformer.decoder.norm.weight in model is torch.Size([256])"I downloaded from techches website weight directly, is this why?
Please don't hesitate to enlighten me!

@rentainhe
Copy link
Collaborator

Hello, would u like to provide more info about your training config:

And I think you don't have to half the batch_size and learning rate, you can use gradient_checkpoint to lower the gpu memory usage and keep the batch_size the same for training.

@ysysys666
Copy link
Author

train.init_checkpoint = "./configs/dino-swin/swin_small_patch4_window7_224_22kto1k_finetune.pth"
train.output_dir = "./output/dino_swin_small_224_4scale_12ep_8bs"

train.max_iter = 180000

optimizer.lr = 5e-5

dataloader.train.total_batch_size = 8

other config is the same as "dino_swin_small_224_4scale_12ep.py"

@ysysys666
Copy link
Author

@rentainhe excuse me,Have you encountered similar problems when loading swin-s weights
微信图片_20240111174114

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