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

shape of tensor #22

Open
Zheshinimenbiwode opened this issue Dec 14, 2024 · 0 comments
Open

shape of tensor #22

Zheshinimenbiwode opened this issue Dec 14, 2024 · 0 comments

Comments

@Zheshinimenbiwode
Copy link

hi, yizhi ! Thank you for sharing the code.
During running test_few_shot, I found (selected_cls.shape) shows torch.Size([52, 4]), which is against your note: # selected_cls: [bs, nshot] (batch_size should be 64 while 52 seems to be char_num)
and brings the error:
selected_cls_ = selected_cls_.expand(images_of_onefont.size(0), nums, opts.img_size, opts.img_size)
RuntimeError: The expanded size of the tensor (64) must match the existing size (52) at non-singleton dimension 0. Target sizes: [64, 4, 64, 64]. Tensor sizes: [52, 4, 1, 1].
I can't orientation the problem, should I just reshape all the tensor? Help me please.

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

1 participant