Commit 9b0d313d authored by Amir MOHAMMADI's avatar Amir MOHAMMADI

[callbacks] use logging instead of print

parent 4623a148
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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment