Handling exceptions raised by forward
during a training step
#15188
Unanswered
jangop
asked this question in
Lightning Trainer API: Trainer, LightningModule, LightningDataModule
Replies: 1 comment
-
Returning |
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.
-
A model might raise an exception during its
forward
, as, for example, torchvision's currentGeneralizedRCNN
does:https://github.com/pytorch/vision/blob/0610b13ac4af3717f538454a9c6b1f441cb386f3/torchvision/models/detection/generalized_rcnn.py#L95
While one might consider this problematic in general, I would like to get around it by essentially skipping a batch if an exception occurs:
The problem is that PL expects a loss returned. Is there any sensible way to go about this?
Beta Was this translation helpful? Give feedback.
All reactions