BottleneckTransformers icon indicating copy to clipboard operation
BottleneckTransformers copied to clipboard

RuntimeError: The size of tensor a (4) must match the size of tensor b (196) at non-singleton dimension 2

Open YePG opened this issue 3 years ago • 3 comments

RuntimeError: The size of tensor a (4) must match the size of tensor b (196) at non-singleton dimension 2

I'm using your code. And I didn't make any changes

YePG avatar Apr 16 '21 05:04 YePG

I run the main.py

YePG avatar Apr 18 '21 05:04 YePG

@YePG, you need to change the settings of ImageNet to CIFAR-10 in the model file

line 144: def ResNet50(num_classes=10, resolution=(32, 32), heads=4):

mfawzy avatar Apr 26 '21 22:04 mfawzy

Thank you. I have solved this problem. Have you pre-trained on Image Net before?Can you provide me with the best model file?

------------------ 原始邮件 ------------------ 发件人: @.>; 发送时间: 2021年4月27日(星期二) 上午6:09 收件人: @.>; 抄送: @.>; @.>; 主题: Re: [leaderj1001/BottleneckTransformers] RuntimeError: The size of tensor a (4) must match the size of tensor b (196) at non-singleton dimension 2 (#13)

@YePG, you need to change the settings of ImageNet to CIFAR-10 in the model file

line 144: def ResNet50(num_classes=10, resolution=(32, 32), heads=4):

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

YePG avatar Apr 27 '21 13:04 YePG