You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# vis_cam 194 lineifargs.vit_like:
# For ViT models, the final classification is done on the class token.# And the patch tokens and class tokens won't interact each other after# the final attention layer. Therefore, we need to choose the norm# layer before the last attention layer.num_extra_tokens=args.num_extra_tokensorgetattr(
model.backbone, 'num_extra_tokens', 1)
out_type=getattr(model.backbone, 'out_type')
ifout_type=='cls_token'ornum_extra_tokens>0:
# Assume the backbone feature is class token.name, layer=norm_layers[-3]
print('Automatically choose the last norm layer before the 'f'final attention block "{name}" as the target layer.')
return [layer]
分支
main 分支 (mmpretrain 版本)
描述该错误
我尝试使用
mmpretrain/tools/visualization/vis_cam.py
时出现了一个问题按照官方文档进行 可视化 Transformer 类型网络的类别激活图
然后出现了报错
我查看了在
vis_cam
中的代码然后尝试输出了model.backbone的所有属性,并没有找到
Swin_Transformer
的out_type
属性随后尝试了指定目标层
还是报错,提示我
norm3
这层不可用,请选择下面的层我几乎把所有层都试了一次,但还是出现这个问题
环境信息
其他信息
No response
The text was updated successfully, but these errors were encountered: