salesforce / BLIP

PyTorch code for BLIP: Bootstrapping Language-Image Pre-training for Unified Vision-Language Understanding and Generation
BSD 3-Clause "New" or "Revised" License
4.85k stars 648 forks source link

RuntimeError: The size of tensor a (6) must match the size of tensor b (18) at non-singleton dimension 0 #161

Closed Pengxin-Guo closed 1 year ago

Pengxin-Guo commented 1 year ago
 models/med.py
attention_scores = torch.matmul(query_layer, key_layer.transpose(-1, -2))

RuntimeError: The size of tensor a (6) must match the size of tensor b (18) at non-singleton dimension 0

Why is this error reported during the test phase when the training phase is normal?

uestcMeng commented 1 year ago

I encountered the same error, do you have any solution?