sys.getrefcount() of a LightningModule #12575
Unanswered
MGheini
asked this question in
Lightning Trainer API: Trainer, LightningModule, LightningDataModule
Replies: 0 comments
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.
-
Hi,
When I run this piece of code
I get
So basically LightningModule has one extra reference created compared to the conventional torch Moule. In my particular case, for instance, this results in memory issues: even if I explicitly do
del b
the memory is not released, and I believe this is the root of the issue. Can you advise me on why this is the case, and how I can consequentlydel
a LightningModule?Thanks!
Beta Was this translation helpful? Give feedback.
All reactions