Is there a simple way to use old (PyTorch Lightning < 1.6) global_step
update behavior?
#13017
-
I have 1 generator and 2 discriminators ( The following code work in PyTorch Lightning < 1.6, class PrunedModule(pl.LightningModule):
"""Apply pruning when self.global_step == 10000"""
def training_step_end(self, _):
if self.global_step == 10000:
# apply pruning
class PrunedGAN(PruningLightningModule):
def training_step(batch, batch_idx):
# ...
optimizer_g.step()
if self.global_step % 2 == 0:
# ...
# update d_a
optimizer_d_a.step()
if self.global_step % 3 == 0:
# ...
# update d_b
optimizer_d_b.step() In PyTorch Lightning 1.6, the If I use Is there a simple way to use old (PyTorch Lightning < 1.6) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
#13752 (comment) might be relevant to your question. |
Beta Was this translation helpful? Give feedback.
#13752 (comment) might be relevant to your question.