The size of tensor a (64) must match the size of tensor b (4096) at non-singleton dimension 0
adventseo opened this issue · comments
Assuming this is the same cause of the The size of tensor a (8) must match the size of tensor b (64) at non-singleton dimension 0
error I've seen on my environment, I resolved this error by downgrading to Transformers 4.26.1
Upgrading to Transformers>=4.27 causes this error with that matmul line in BLIP, so it must be incompatible.
!pip install torch
!pip install torchvision
!pip install transformers==4.15.0
!pip install open_clip_torch
!pip install clip-interrogator==0.5.0
Fixed the issue for me, thanks everyone, especially @bradley-pearson6597 for the solution