added model save load test

This commit is contained in:
William Falcon
2019-07-26 21:55:01 -04:00
parent 0ee0344820
commit 4148c36abd
2 changed files with 60 additions and 3 deletions
@@ -81,10 +81,10 @@ class TrainerIO(object):
# request what to save from the model
model = self.__get_model()
checkpoint_dict = model.get_save_dict()
# merge trainer and model saving items
checkpoint['state_dict'] = checkpoint_dict
checkpoint.update(checkpoint_dict)
# add the state_dict from the model
checkpoint['state_dict'] = checkpoint_dict
return checkpoint
# --------------------
@@ -186,6 +186,7 @@ class TrainerIO(object):
# call model hook
model.on_hpc_load()
def max_ckpt_in_folder(self, path):
files = os.listdir(path)
files = [x for x in files if 'ckpt_' in x]