Skip to content

Commit

Permalink
save training history
Browse files Browse the repository at this point in the history
  • Loading branch information
taxe10 committed Feb 24, 2024
1 parent 323b17d commit 3d927d7
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/train_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,19 @@
model.summary()

# fit model while also keeping track of data for dash plots
model.fit(train_generator,
validation_data=val_generator,
epochs=epochs,
verbose=0,
callbacks=[TrainCustomCallback()],
shuffle=data_parameters.shuffle)
history = model.fit(
train_generator,
validation_data=val_generator,
epochs=epochs,
verbose=0,
callbacks=[TrainCustomCallback()],
shuffle=data_parameters.shuffle
)

# save model
model.save(args.output_dir+'/model.keras')
with open(args.output_dir+'/class_info.json', 'w') as json_file:
json.dump(classes, json_file)
with open(args.output_dir+'/history.json', 'w') as json_file:
json.dump(history.history, json_file)
logging.info("Training process completed")

0 comments on commit 3d927d7

Please sign in to comment.