DingXiaoH / RepLKNet-pytorch

Scaling Up Your Kernels to 31x31: Revisiting Large Kernel Design in CNNs (CVPR 2022)
MIT License
860 stars 86 forks source link

Validation metric difference between saving state_dict() and the whole model. #51

Open Grace625 opened 1 year ago

Grace625 commented 1 year ago

Thanks for your excellent work!

I use RepLKNet as the backbone of my depth estimation network. After validating the model at training time, I save it and immediately load it to validate again, but I get different validation metrics from the training time.

I use the standard way in PyTorch to save the state_dict() of RepLKNet, and when I use torch.save() to save the whole model rather than only save the state_dict() of the backbone, this problem disappears. Why does this happen? Looking forward to your reply.