HVision-NKU/SRFormer

Pretrain base models shape(/parameters) missmatch with training config

Phhofm opened this issue · 1 comments

Phhofm commented

When using the "SRFormer_SRx2_DF2K.pth" model as a pretrain for training another model, I ran into shape missmatch errors.
So I checked and recognized that the parameters in the current training config are different (=incompatible) with the ones that had been used for those pretrained models.

The SRFormer/options/train/SRFormer/train_SRFormer_SRx2_scratch.yml file uses an img_size: 48 and window_size: 24 while the pretrain had been trained with (as seen in SRFormer/options/test/SRFormer/test_SRFormer_DF2Ksrx2.yml) with img_size: 64 and window_size: 22.

This is meant as an information for someone wanting to train a base model (or do inference with one of the base pretrains), if you want to use the released pretrain models as a pretrain, you need to adapt the parameters in the train config (simply copy the network settings from the test config).

The lightweight model does not suffer from this inconsistency, the test and training configs hold the same network parameters.

Thanks for pointing this out. When we train our model on DF2k dataset, we found change window size from 24 to 22 will reduce needed gpu numbers. This is only related to our training environment. If you retrain a model, it is also free to set the window size to 24.