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

Prediction failed due to The size of tensor #295

Open
DNucX opened this issue Jan 26, 2024 · 0 comments
Open

Prediction failed due to The size of tensor #295

DNucX opened this issue Jan 26, 2024 · 0 comments

Comments

@DNucX
Copy link

DNucX commented Jan 26, 2024

Hello,

I have the following error when attempting to run predict:

Traceback (most recent call last):
  File "/home/user/pythonProjects/lama/bin/predict.py", line 84, in main
    batch = model(batch)
  File "/home/user/pythonProjects/inpenv/lib64/python3.6/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/home/user/pythonProjects/lama/saicinpainting/training/trainers/default.py", line 59, in forward
    masked_img = img * (1 - mask)
RuntimeError: The size of tensor a (512) must match the size of tensor b (504) at non-singleton dimension 3

This only happened for one image. The image is jpg and the mask is png. Both have the same dimensions. For some reason, this particular image produces the above error. All other images that I have tried thus far worked.

The above was ran with: refine=False and device=cpu

Any insight is greatly appreciated! Thank you!

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