semantic segmentation: validation with torchmetric extremely slow #16088
Unanswered
lukazso
asked this question in
Lightning Trainer API: Trainer, LightningModule, LightningDataModule
Replies: 1 comment
-
@lukazso I'd run both of your scripts with a profiler to spot where the PL code takes longer than the non-PL code: python -m cProfile your_pl_script.py
python -m cProfile your_non_pl_script.py cc @SkafteNicki @justusschock who might be able to explain the difference |
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.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I recently tried to implement a DeepLabV3 training pipeline. I wanted to use the build-in
torchmetrics.JaccardIndex
as my evaluation metric. MyLightningModule
looks like this:When using this validation procedure, it is extremely slow. On average, the update step of the metric takes 23.4 seconds. However, the first 3 updates are very fast (<1 second), then they become slow.
I tried to reproduce this behavior in a MWE:
Here I get an average update duration of 0.03 seconds, so I do not encounter the extremely slow update as in my
LightningModule
above. Can someone help me with an explanation for that?Here some training information for my pytorch-lightning training pipeline:
Thanks so much!
Lukas
Beta Was this translation helpful? Give feedback.
All reactions