TypeError: all() received an invalid combination of arguments - got (Tensor, keepdim=bool, dim=tuple), but expected one of

#8
by tukey - opened

Hi,
I was using the example code from the website and this error emerges. Could someone help me? Thank you!

~/.cache/huggingface/modules/transformers_modules/allenai/Molmo-72B-0924/c5e3bf4188872b99457c021d098c8885bbdf41a8/modeling_molmo.py in encode_image(self, images)
1341 B, T, N, D = images.shape
1342
-> 1343 mask = ~torch.all(images.view(B * T, N, D) == -1, dim=(1, 2), keepdim=True)
1344
1345 # Output all hidden states

TypeError: all() received an invalid combination of arguments - got (Tensor, keepdim=bool, dim=tuple), but expected one of:

  • (Tensor input, *, Tensor out)
    didn't match because some of the keywords were incorrect: keepdim, dim
  • (Tensor input, int dim, bool keepdim, *, Tensor out)
  • (Tensor input, name dim, bool keepdim, *, Tensor out)
Ai2 org

Try upgrading to torch >= 2.2

Sign up or log in to comment