Prediction failed due to The size of tensor
DNucX opened this issue · comments
DNucX commented
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!