tensorrtx icon indicating copy to clipboard operation
tensorrtx copied to clipboard

SWIN transformer pretrained model issue

Open abhiagwl4262 opened this issue 3 years ago • 2 comments
trafficstars

About this repo

  • commit - https://github.com/wang-xinyu/tensorrtx/commit/0f944b89750c2cd2e6be7933f84d61eb4e34ec83?
  • model - SWIN-Transformer

Your problem

python gen_wts.py upernet_swin_tiny_patch4_window7_512x512.pth 
Traceback (most recent call last):
  File "gen_wts.py", line 8, in <module>
    model = torch.load(pt_file, map_location=torch.device('cpu'))['model'].float()  # load to FP32
KeyError: 'model' 

Can you please provide the link to the pre-trained model you used for swin usecase or modify the script such that we are able to use the pretrained model from https://github.com/SwinTransformer/Swin-Transformer-Semantic-Segmentation repo ?

abhiagwl4262 avatar Jul 13 '22 12:07 abhiagwl4262

@wdhao was using a custom model, but the code can still be referenced.

@abhiagwl4262 If you can adapt the code to make it work with the pretrained model, then welcome your PR.

wang-xinyu avatar Jul 18 '22 04:07 wang-xinyu

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 16 '22 07:09 stale[bot]