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 #1

Open
Jypeng-64 opened this issue Apr 25, 2023 · 2 comments
Open

error #1

Jypeng-64 opened this issue Apr 25, 2023 · 2 comments

Comments

@Jypeng-64
Copy link
Owner

UserWarning: Using a target size (torch.Size([64])) that is different to the input size (torch.Size([64, 384, 64, 64])). This will likely lead to incorrect results due to broadcasting. Please ensure they have the same size.
return F.mse_loss(input, target, reduction=self.reduction)

@Jypeng-64
Copy link
Owner Author

/home/densogup-1/lyj/dev/venv/lib/python3.8/site-packages/torch/nn/modules/loss.py:529: UserWarning: Using a target size (torch.Size([64])) that is different to the input size (torch.Size([64, 384, 64, 64])). This will likely lead to incorrect results due to broadcasting. Please ensure they have the same size.
return F.mse_loss(input, target, reduction=self.reduction)
Traceback (most recent call last):
File "/media/densogup-1/8T/jyp/myad/src/pretrained_teacher.py", line 93, in
loss.backward()
File "/home/densogup-1/lyj/dev/venv/lib/python3.8/site-packages/torch/_tensor.py", line 363, in backward
torch.autograd.backward(self, gradient, retain_graph, create_graph, inputs=inputs)
File "/home/densogup-1/lyj/dev/venv/lib/python3.8/site-packages/torch/autograd/init.py", line 173, in backward
Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass
RuntimeError: Found dtype Long but expected Float

@Jypeng-64
Copy link
Owner Author

RuntimeError: The expanded size of the tensor (64) must match the existing size (16) at non-singleton dimension 3. Target sizes: [16, 384, 64, 64]. Tensor sizes: [16]

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