Xiyue-Wang/TransPath

CTransPath: weights mismatch of swin_tiny_patch4_window7_224

saghiralfasly opened this issue · 8 comments

Hi @Xiyue-Wang

Thank you for making your work available, I appreciate your effort.

I tried to load CTransPath using the exact instructions, but it seems there is mismatch between the available weights and swin_tiny_patch4_window7_224.

I downloaded the weights from this link as it is explained here:
https://drive.google.com/file/d/1DoDx_70_TLj98gTf6YTXnu4tFhsFocDX/view
image

When I try to run the script and load the model:
python get_features_CTransPath.py

I got this error:
image

How use define your model ?
Look like use the default Swin, which employs a different patch embed compared to CTransPath (ConvStem).

How use define your model ? Look like use the default Swin, which employs a different patch embed compared to CTransPath (ConvStem).

I tried to run this line as it is:

python get_features_CTransPath.py

@saghiralfasly see here
image

and python get_features_CTransPath.py

hi, I meet a similar problem. I install the modified timm-0.5.4. I load the vit_small.pth.tar['state_dict'] and find there are 342 groups params. But there are 304 groups params in the model MoCo_ViT.

just like @Xiyue-Wang said, you need to install the right version of the modified timm package, instead of the wheel installation

@HaoyuCui @Xiyue-Wang Hi, I tried to use the command pip install timm-0.5.4.tar to install the modified timm package, but got an ERROR:
屏幕截图 2023-10-11 151841
So I used pip install timm==0.5.4, but still meet the same problem when load the pre-trained CTranspath. May I ask if there is any problem with my operation?
屏幕截图 2023-10-11 152833

@Wan-Jiayu DO NOT directly use pip install, use the drive link they providetimm_modified
store the file locally and then install the package
pip install /YOUR/LOCATION/TO/PACKAGE/timm-0.5.4.tar (with your absolute path)

@HaoyuCui Thank you very much!!!The problem has been sovoled.