We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b3c8158 commit 7da1230Copy full SHA for 7da1230
paddlehub/finetune/trainer.py
@@ -147,7 +147,11 @@ def _save_metrics(self):
147
pickle.dump(self.best_metrics, file)
148
149
def _load_metrics(self):
150
- with open(os.path.join(self.checkpoint_dir, 'metrics.pkl'), 'rb') as file:
+ metrics_file = os.path.join(self.checkpoint_dir, 'metrics.pkl')
151
+ if not os.path.exists(metrics_file):
152
+ return
153
+
154
+ with open(metrics_file, 'rb') as file:
155
self.best_metrics = pickle.load(file)
156
157
def train(self,
0 commit comments