Closed BotaoPeng98 closed 12 months ago
Thanks for your interest in our work!
I think below check list will help you solve the issue.
First, check the version of timm>=0.9.2
.
Second, change pretrained=True
in timm.create_model
into pretrained=False
.
timm.create_model('twins_svt_large',pretrained=True)
first download the pretrained model from Hub and then load it from local cache.
But, it is not required to run our codes because provided BiFormer_Weights.zip
contains the parameters of the encoder.
Hence, you can easily turn off the loading that option like below snippet. (I changed pretrained=True
into pretrained=False
)
https://github.com/JunHeum/BiFormer/blob/91ddc9c29b1ab10eb91b5188317e7f4f4b3df981/model/BiFormer.py#L35-L41
Thank you so much. May you be happy every day, and succeed in your work!
Hi, Dr. Junheum Park,
Thanks for releasing code of your fabulous work!
When I was debugging the code, it got an error.
I located where the error came from. it seems that the 'timm.creat_model('twins_svt_large', pretrained=pretrained)' failed to download the twins pre-trained model.
Then I searched on HF, I inferred you might use the model from here. Then, I download
pytorch_model.bin
from it, and modified the codetimm.creat_model('twins_svt_large
, pretrained=pretrained)' totimm.creat_model('twins_svt_large', pretrained=pretrained, pretrained_cfg_overlay=dict(file='path/to/checkpoint/pytorch_model.bin'))
, so that it can load the model that I have downloaded.However, another error emerged.
It seemed that I got the wrong pretrained model whose channels are mismatched.
Could you help me figure out what I did wrong? How can I solve this problem?
Thanks again.
Botao Peng