提交 7da12302 编写于 作者: W wuzewu

Fixed the problem that the training cannot be resumed when there is no metric...

Fixed the problem that the training cannot be resumed when there is no metric file in the checkpoint.
上级 b3c81580
......@@ -147,7 +147,11 @@ class Trainer(object):
pickle.dump(self.best_metrics, file)
def _load_metrics(self):
with open(os.path.join(self.checkpoint_dir, 'metrics.pkl'), 'rb') as file:
metrics_file = os.path.join(self.checkpoint_dir, 'metrics.pkl')
if not os.path.exists(metrics_file):
return
with open(metrics_file, 'rb') as file:
self.best_metrics = pickle.load(file)
def train(self,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册