Skip to content

Commit

Permalink
🐛 Fix Expected a parent bug, see [the solution](Lightning-AI/pytorch-…
Browse files Browse the repository at this point in the history
  • Loading branch information
Haneol-Kijm committed Sep 15, 2024
1 parent 53a5d12 commit eb820ed
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions engine/callbacks.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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!!")

0 comments on commit eb820ed

Please sign in to comment.