D-FINE icon indicating copy to clipboard operation
D-FINE copied to clipboard

How to train images of size 1280?

Open tms2003 opened this issue 1 year ago • 1 comments

I want to train the weights of images of size 1280 for comparison. In addition to changing 640 to 1280 in dataloader.yml, what else needs to be changed? For example: collate_fn: type: BatchImageCollateFuncion scales: [480, 512, 544, 576, 608, 672, 704, 736, 768, 800] scale_ori_repeat: 3 stop_epoch: 72 # epoch in [72, ~) stop Do I need to add 1280 to scales in multiscales? Similarly, does dfine_hgnetv2_x_custom.yml need to be modified?

tms2003 avatar Dec 04 '24 06:12 tms2003

The author missed 1 setting

Suppose I want to train for size 768,

  1. In D-FINE/configs/dfine/include/dfine_hgnetv2.yml, eval_spatial_size: [768, 768] # h w

  2. dataloader.yml


train_dataloader:
  dataset:
    transforms:
      ops:
...
        - {type: RandomZoomOut, fill: 0, p: 0}
        - {type: Resize, size: [768, 768], } <-------
...

  collate_fn:
    type: BatchImageCollateFunction
    base_size: 768 <-------
    base_size_repeat: 3
    stop_epoch: 72 # epoch in [72, ~) stop `multiscales`

...


val_dataloader:
  dataset:
    transforms:
      ops:
        - {type: Resize, size: [768, 768], }  <-------
        - {type: ConvertPILImage, dtype: 'float32', scale: True}
...

Also adjust batch size accordingly

prashant-dn avatar Jan 07 '25 06:01 prashant-dn