Problem with running the validation tests #12826
Unanswered
pamparana34
asked this question in
Lightning Trainer API: Trainer, LightningModule, LightningDataModule
Replies: 1 comment
-
loss = torch.stack([x["loss"] for x in outputs]).mean() are you sure this is happening during validation? the code-snippet is present in RuntimeError: stack expects each tensor to be equal size, but got [64, 1] at entry 0 and [35, 1] at entry 1658 is your loss not a scalar value? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am using pytorch lightning and have defined my training epoch end and validation epoch end as follows:
Now, I have data loaders like:
The issue is the training loop is fine but when I run the validation loop, it comes back with:
Do you think this is because of the
batch_size
which is set to 64 and maybe gets truncated at the last slice? How can I solve this?Beta Was this translation helpful? Give feedback.
All reactions