You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "LUM_train.py", line 156, in
main()
File "LUM_train.py", line 134, in main
r_x, i_x = light(val_x)
File "/anaconda/envs/azureml_py38/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "/mnt/batch/tasks/shared/LS_root/mounts/clusters/deepakpanda4/code/Users/deepakpanda/HEP/models/LUM_model.py", line 48, in forward
cat5 = torch.cat((x5, x2), dim=1)
RuntimeError: Sizes of tensors must match except in dimension 1. Expected size 766 but got size 765 for tensor number 1 in the list.
The text was updated successfully, but these errors were encountered:
This is due to the size of your valid images, which you can solve by replacing the torch.cat with the following code:
def cat_(x01, x02):
diffY = x02.size()[2] - x01.size()[2]
diffX = x02.size()[3] - x01.size()[3]
x01 = F.pad(x01, (diffX // 2, diffX - diffX // 2, diffY // 2, diffY - diffY // 2))
x = torch.cat([x02, x01], dim=1)
return x
Traceback (most recent call last):
File "LUM_train.py", line 156, in
main()
File "LUM_train.py", line 134, in main
r_x, i_x = light(val_x)
File "/anaconda/envs/azureml_py38/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "/mnt/batch/tasks/shared/LS_root/mounts/clusters/deepakpanda4/code/Users/deepakpanda/HEP/models/LUM_model.py", line 48, in forward
cat5 = torch.cat((x5, x2), dim=1)
RuntimeError: Sizes of tensors must match except in dimension 1. Expected size 766 but got size 765 for tensor number 1 in the list.
The text was updated successfully, but these errors were encountered: