From 3fc41e827cd61813596d85b2985a9668a0e9998e Mon Sep 17 00:00:00 2001 From: kAIto47802 <115693559+kAIto47802@users.noreply.github.com> Date: Fri, 25 Oct 2024 15:51:43 +0900 Subject: [PATCH] Add removal of temporal file --- pytorch/pytorch_checkpoint.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pytorch/pytorch_checkpoint.py b/pytorch/pytorch_checkpoint.py index e7f2b5d6..70b458ce 100644 --- a/pytorch/pytorch_checkpoint.py +++ b/pytorch/pytorch_checkpoint.py @@ -104,6 +104,7 @@ def objective(trial): artifact_id=artifact_id, ) checkpoint = torch.load(f"./tmp_model_{trial.number}.pt") + os.remove(f"./tmp_model_{trial.number}.pt") epoch = checkpoint["epoch"] epoch_begin = epoch + 1