Closed KKIverson closed 1 year ago
运行get_features_CTransPath.py时,加载模型报错:
RuntimeError: Error(s) in loading state_dict for SwinTransformer: Missing key(s) in state_dict: "patch_embed.proj.weight", "patch_embed.proj.bias". Unexpected key(s) in state_dict: "patch_embed.proj.0.weight", "patch_embed.proj.1.weight", "patch_embed.proj.1.bias", "patch_embed.proj.1.running_mean", "patch_embed.proj.1.running_var", "patch_embed.proj.1.num_batches_tracked", "patch_embed.proj.3.weight", "patch_embed.proj.4.weight", "patch_embed.proj.4.bias", "patch_embed.proj.4.running_mean", "patch_embed.proj.4.running_var", "patch_embed.proj.4.num_batches_tracked", "patch_embed.proj.6.weight", "patch_embed.proj.6.bias".
模型文件和模型代码是不是不一致啊?我用的timm版本是一致的
解决了,我的timm没有安装作者指定的版本
运行get_features_CTransPath.py时,加载模型报错:
RuntimeError: Error(s) in loading state_dict for SwinTransformer: Missing key(s) in state_dict: "patch_embed.proj.weight", "patch_embed.proj.bias". Unexpected key(s) in state_dict: "patch_embed.proj.0.weight", "patch_embed.proj.1.weight", "patch_embed.proj.1.bias", "patch_embed.proj.1.running_mean", "patch_embed.proj.1.running_var", "patch_embed.proj.1.num_batches_tracked", "patch_embed.proj.3.weight", "patch_embed.proj.4.weight", "patch_embed.proj.4.bias", "patch_embed.proj.4.running_mean", "patch_embed.proj.4.running_var", "patch_embed.proj.4.num_batches_tracked", "patch_embed.proj.6.weight", "patch_embed.proj.6.bias".
模型文件和模型代码是不是不一致啊?我用的timm版本是一致的