Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The size of tensor a (6) must match the size of tensor b (160) at non-singleton dimension 0 #70

Open
ShivankYadav opened this issue Jan 19, 2023 · 5 comments

Comments

@ShivankYadav
Copy link

Hi, I am trying to run the pretrained vit_transreid_veri.pth weights directly for testing purposes. In the vit_transreid.yml, I tried with MODEL.PRETRAIN_CHOICE as both imagenet and self with models "jx_vit_base_p16_224-80ecf9dd.pth" and "vit_transreid_veri.pth" but still getting the same error during test weights loading phase.
===========building transformer with JPM module ===========
Traceback (most recent call last):
File "test.py", line 48, in
model.load_param(cfg.TEST.WEIGHT)
File "/app/model/make_model.py", line 376, in load_param
self.state_dict()[i.replace('module.', '')].copy_(param_dict[i])
RuntimeError: The size of tensor a (6) must match the size of tensor b (160) at non-singleton dimension 0

@heshuting555
Copy link
Collaborator

The possible reason is that the size of position embedding or side embedding does not match, you can print print(i, self.state_dict()[i.replace('module.', '')].shape, param_dict[i].shape) to know why the error occurs.

@Hocason
Copy link

Hocason commented Apr 21, 2023

The possible reason is that the size of position embedding or side embedding does not match, you can print print(i, self.state_dict()[i.replace('module.', '')].shape, param_dict[i].shape) to know why the error occurs.

Hi,
Why the dimension of base.sie_embed changes when I use different datasets? The transformer type is vit_base_patch16_224_TransReID. What is base.sie_embed?

@ledinhtri97
Copy link

ledinhtri97 commented Oct 11, 2023

Hi @heshuting555 , Seem the size dimension changes when use other dataset based on num_class=num_classes, camera_num=camera_num, view_num=view_num?. How to load pre-trained model and test with difference data?

Thank you

@kp97524
Copy link

kp97524 commented Nov 14, 2023

Hi @heshuting555,

Is there any update on this issue? I am trying to load the model trained on VeRi dataset and test on MarketPlace dataset!

Has the same requirement as @ledinhtri97

Any help is super appreciated!

@Qjrrrrrrro-O
Copy link

Hi @heshuting555,

Is there any update on this issue? I am trying to load the model trained on VeRi dataset and test on MarketPlace dataset!

Has the same requirement as @ledinhtri97

Any help is super appreciated!

Have you solved it? I have encountered the same problem as well. Any help is appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants