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

Error about "RuntimeError: output with shape [] doesn't match the broadcast shape [3, 189, 275]” #56

Open
sunohm opened this issue Aug 2, 2022 · 0 comments

Comments

@sunohm
Copy link

sunohm commented Aug 2, 2022

Hi,nmhkahn.
when i run " carn/sample.py "
I got an error about "RuntimeError: output with shape [] doesn't match the broadcast shape [3, 189, 275]"
lr_patch = torch.tensor((4, 3, h_chop, w_chop), dtype=torch.float)
print("tensor.ndim",lr_patch.ndim)
print("tensor.shape", lr_patch.shape)
print("lr_patch",lr_patch)
lr_patch[0].copy_(lr[:, 0:h_chop, 0:w_chop])
lr_patch[1].copy_(lr[:, 0:h_chop, w-w_chop:w])
lr_patch[2].copy_(lr[:, h-h_chop:h, 0:w_chop])
lr_patch[3].copy_(lr[:, h-h_chop:h, w-w_chop:w])
lr_patch = lr_patch.to(device)
print:
h_half,w_half 169 255
h_chop,w_chop 189 275
tensor.ndim 1
tensor.shape torch.Size([4])
lr_patch tensor([ 4., 3., 189., 275.])
I really don't understand why,so i need your help, 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