jeonsworld / ViT-pytorch

Pytorch reimplementation of the Vision Transformer (An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale)
MIT License
1.95k stars 374 forks source link

how can I use the output .bin file again ? #53

Closed mohammedkw11 closed 1 year ago

mohammedkw11 commented 1 year ago

Hi,

Thank you for sharing this great work!

I want to use .bin file again. how I can do that.

Best, Mohammed

deepankarvarma commented 10 months ago

Did you do that @mohammedkw11 , if yes can you please share the notebook link?

Zhenyu001225 commented 9 months ago

Did you do that @mohammedkw11 , if yes can you please share the notebook link?

Try to revise the setup function: Revise: model.load_from(np.load(args.pretrained_dir)) To: state_dict = torch.load(args.pretrained_dir, map_location='cuda') model.load_state_dict(state_dict, strict=False)