File tree Expand file tree Collapse file tree 4 files changed +11
-8
lines changed
Expand file tree Collapse file tree 4 files changed +11
-8
lines changed Original file line number Diff line number Diff line change 11# Changelog
2+ ## [ 1.5.9] Minor fix
3+
4+ ## Changed
5+ - Replaced torch.save with atomic_save of PyDGN to handle cases where metrics data storage corrupted the file
6+
7+
28## [ 1.5.8] Minor fix
39
410## Fixed
Original file line number Diff line number Diff line change 2424author = "Federico Errica"
2525
2626# The full version, including alpha/beta/rc tags
27- release = "1.5.8 "
27+ release = "1.5.9 "
2828
2929
3030# -- General configuration ---------------------------------------------------
Original file line number Diff line number Diff line change 22from pathlib import Path
33
44import torch
5+ from pydgn .training .util import atomic_save
56from torch .utils .tensorboard import SummaryWriter
67
78from pydgn .static import *
@@ -33,7 +34,7 @@ def __init__(self,
3334 self .writer = SummaryWriter (log_dir = Path (self .exp_path , "tensorboard" ))
3435
3536 self .stored_metrics = {"losses" : {}, "scores" : {}}
36- self .stored_metrics_path = Path (self .exp_path , "metrics_data.torch " )
37+ self .stored_metrics_path = Path (self .exp_path , "metrics_data.pt " )
3738 if os .path .exists (self .stored_metrics_path ):
3839 self .stored_metrics = torch .load (self .stored_metrics_path )
3940
@@ -87,11 +88,7 @@ def on_epoch_end(self, state: State):
8788 self .stored_metrics [t ][k ].append (v .item ())
8889
8990 if self .store_on_disk :
90- try :
91- torch .save (self .stored_metrics , self .stored_metrics_path )
92- except RuntimeError as e :
93- print (e )
94-
91+ atomic_save (self .stored_metrics , self .stored_metrics_path )
9592
9693 def on_fit_end (self , state : State ):
9794 """
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44
55[project ]
66name = " pydgn"
7- version = " 1.5.8 "
7+ version = " 1.5.9 "
88description = " A Python Package for Deep Graph Networks"
99authors = [ { name =" Federico Errica" , email =" f.errica@protonmail.com" } ]
1010readme = " README.md"
You can’t perform that action at this time.
0 commit comments