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

In train_RINDNet.py, size mismatch error #12

Open
carwyn987 opened this issue Feb 14, 2023 · 1 comment
Open

In train_RINDNet.py, size mismatch error #12

carwyn987 opened this issue Feb 14, 2023 · 1 comment

Comments

@carwyn987
Copy link

carwyn987 commented Feb 14, 2023

Line 89:

loss = self.criterion([out_depth,out_normal,out_reflectance,out_illumination], target[:, 1:5, :, :])

I get the following error:

ValueError: Using a target size (torch.Size([4, 320, 320])) that is different to the input size (torch.Size([5, 1, 320, 320])) is deprecated. Please ensure they have the same size.

Fixed by replacing line with:

loss = self.criterion(torch.cat((out_depth,out_normal,out_reflectance,out_illumination),axis=1), target[:, 1:5, :, :])

Unsure if this fix breaks training, but fixes error and allows training to commence.

Using Python 3.7, numpy 1.19.5, torch 1.13.1, opencv-python 4.3.0.38, ...

@MengyangPu
Copy link
Owner

Thanks, this fix will not affect training, or replacing line with:
loss = self.criterion(torch.cat((out_depth,out_normal,out_reflectance,out_illumination),dim=1), target[:, 1:5, :, :])

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

2 participants