dinov2 icon indicating copy to clipboard operation
dinov2 copied to clipboard

scaling down number of epoch to 1

Open clemsgrs opened this issue 11 months ago • 1 comments

hi, i am using the DINOv2 codebase to train a ViT on a custom dataset of ~100M images. i would like to do only one pass over this dataset, as it is much more redundant than natural images (hence no clear benefit of seing the same images multiple times). in the configuration file, there are a few epoch-defined parameters:

  • warmup_epochs
  • warmup_teacher_temp_epochs
  • freeze_last_layer_epochs

when epoch = 100, warmup_epochs = 10, meaning we warm up for 10% of training iterations. when epoch = 1, my idea is to linearly scale down the other epoch-defined parameter and use percentage values instead of fixed integers.

to give a concrete example, i would use warmup_epochs = 0.1 which would always warm up for 10% training iterations the question is: shall these 3 epoch-defined parameters be linearly scaled down or not?

thanks for the help!

clemsgrs avatar Jan 14 '25 12:01 clemsgrs

The default meaning of epoch in this codebase is "1250 iterations". See here and here

So, you just need to set your "epochs" and "warmup_epochs" appropriately for your batch size. e.g. Assuming a batch size of 1024, you'd use something like:

optim:
    epochs: 100000
    warmup_epochs: 10000

(I'm not affiliated with this codebase at all, I've just been looking at it recently)

Multihuntr avatar Jan 16 '25 04:01 Multihuntr