Skip to content

Commit 9b3cf80

Browse files
saving training history to json file
1 parent 9d6a1a0 commit 9b3cf80

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

orthophoto-segmentation-benchmark-toolkit/experiment.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import datetime
22
import zipfile
3+
import json
34
from tensorflow.keras.callbacks import TensorBoard, ModelCheckpoint
45
from tensorflow.keras.backend import clear_session
56
import matplotlib.pyplot as plt
@@ -74,6 +75,8 @@ def train(self, epochs):
7475
callbacks=callbacks
7576
)
7677
self.plot_segm_history(history)
78+
with open(f"{self.basedir}/train_history.json", 'w') as outfile:
79+
json.dump(history.history, outfile)
7780

7881
def generate_inference_test_files(self):
7982
clear_session()

0 commit comments

Comments
 (0)