def get_last_checkpoint(self):
"""
Assumes that the last checpoint has a higher checkpoint id. Checkpoint will be saved in this exact format
model_<checkpint_id>.ckpt Eg - model_100.ckpt
:return:
"""
'''
'''
self.present_checkpoints = glob.glob(self.get_checkpoint_location() + '/*.ckpt')
if len(self.present_checkpoints) != 0:
present_ids = [self.__get_id(ckpt) for ckpt in self.present_checkpoints]
# sort the ID's and return the model for the last ID
present_ids.sort()
self.last_id = present_ids[-1]
self.last_ckpt = self.get_checkpoint_location() + '/model_' +\
str(self.last_id) + '.ckpt'
return self.last_ckpt
评论列表
文章目录