From 397818f6a2b83825bdd7fe7b37546d6d39a79663 Mon Sep 17 00:00:00 2001 From: Akshay Chintalapati <64036106+akshayvkt@users.noreply.github.com> Date: Thu, 26 Oct 2023 00:30:30 -0700 Subject: [PATCH] Update ch13_part3_lightning.ipynb 1. Updated the deprecated modules (training_epoch_end and validation_epoch_end) to on_train_epoch_end and on_validation_epoch_end. 2. Removed 'outs argument from both functions because the model fails to train with the outs argument in the function. The model now successfully trains with these changes. I'm certain change #1 is needed, not sure about change #2 but updating that let me train the model and not error out. --- ch13/ch13_part3_lightning.ipynb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ch13/ch13_part3_lightning.ipynb b/ch13/ch13_part3_lightning.ipynb index c05fc774c..1e5379758 100644 --- a/ch13/ch13_part3_lightning.ipynb +++ b/ch13/ch13_part3_lightning.ipynb @@ -201,7 +201,7 @@ " self.log(\"train_loss\", loss, prog_bar=True)\n", " return loss\n", "\n", - " def training_epoch_end(self, outs):\n", + " def on_train_epoch_end(self):\n", " self.log(\"train_acc\", self.train_acc.compute())\n", " self.train_acc.reset()\n", " \n", @@ -214,8 +214,8 @@ " self.log(\"valid_loss\", loss, prog_bar=True)\n", " return loss\n", " \n", - " def validation_epoch_end(self, outs):\n", - " self.log(\"valid_acc\", self.valid_acc.compute(), prog_bar=True)\n", + " def on_validation_epoch_end(self):\n", + " self.log(\"valid_acc\", self.valid_acc.compute())\n", " self.valid_acc.reset()\n", "\n", " def test_step(self, batch, batch_idx):\n",