From eb820edc0b974b055ce96ba49d0d381c49145353 Mon Sep 17 00:00:00 2001 From: Haneol-Kijm Date: Sun, 15 Sep 2024 16:26:13 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20Expected=20a=20parent=20bu?= =?UTF-8?q?g,=20see=20[the=20solution](https://github.com/Lightning-AI/pyt?= =?UTF-8?q?orch-lightning/issues/17485#issuecomment-1524198677)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- engine/callbacks.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/engine/callbacks.py b/engine/callbacks.py index e4b207d..295013e 100644 --- a/engine/callbacks.py +++ b/engine/callbacks.py @@ -1,4 +1,4 @@ -from pytorch_lightning.callbacks import Callback +from lightning.pytorch.callbacks import Callback import numpy as np import pandas as pd from datetime import date @@ -19,11 +19,4 @@ def on_test_end(self, *args, **kwargs): test_info = test_info.reset_index().rename(columns={"index": "ID"}) file_name = f"{self.model_name}_{date.today()}.csv" test_info.to_csv(file_name, index=False, lineterminator='\n') - print("Output csv file successfully saved!!") - - - def load_state_dict(self, state_dict): - self.predictions = state_dict['predictions'] - - def state_dict(self): - return {'predictions': self.predictions} + print("Output csv file successfully saved!!") \ No newline at end of file