Skip to content

Unit 5 - Exercise 1 #40

May 2, 2023 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

Hello,

thanks for your reply.
That's the error message:
UserWarning: Using a target size (torch.Size([32])) that is different to the input size (torch.Size([32, 1])). This will likely lead to incorrect results due to broadcasting. Please ensure they have the same size.
loss = F.mse_loss(logits, true_labels)

This suggests that the logits have two dimension as the true_labels only have one dimension. This is confirmed when I look at the Tensors so I flattend the one with two dimensions and solved the error message. I only wondered if that leads to errors which I haven't seen yet.

My Outputlayer receives 5 features and gives 1 value out as I'm doing a regression task.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@DSJohannes
Comment options

Answer selected by rasbt
@rasbt
Comment options

@DSJohannes
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants