Skip to content
Snippets Groups Projects
Commit 9b0d313d authored by Amir MOHAMMADI's avatar Amir MOHAMMADI
Browse files

[callbacks] use logging instead of print

parent 4623a148
No related branches found
No related tags found
1 merge request!92Add necessary files to train DeepPixBis
import json
import logging
import os
import tensorflow as tf
logger = logging.getLogger(__name__)
class CustomBackupAndRestore(tf.keras.callbacks.experimental.BackupAndRestore):
"""This callback is experimental and might be removed in future.
......@@ -44,9 +47,9 @@ class CustomBackupAndRestore(tf.keras.callbacks.experimental.BackupAndRestore):
def on_train_begin(self, logs=None):
super().on_train_begin(logs=logs)
if self.restore():
print(f"Restored callbacks from {self.callbacks_backup_path}")
logger.info(f"Restored callbacks from {self.callbacks_backup_path}")
else:
print("Did not restore callbacks")
logger.info("Did not restore callbacks")
def on_epoch_end(self, epoch, logs=None):
super().on_epoch_end(epoch, logs=logs)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment