Ejemplo n.º 1
0
 def __init__(
     self,
     out_dir,
     export_tensorboard=False,
     tensorboard_dir=None,
     dry_run=False,
     reduction_config=None,
     save_config=None,
     include_regex=None,
     include_collections=None,
     save_all=False,
     include_workers="one",
 ):
     TensorflowBaseHook.__init__(
         self,
         out_dir=out_dir,
         export_tensorboard=export_tensorboard,
         tensorboard_dir=tensorboard_dir,
         init_step=-1,
         dry_run=dry_run,
         reduction_config=reduction_config,
         save_config=save_config,
         include_regex=include_regex,
         include_collections=include_collections,
         save_all=save_all,
         include_workers=include_workers,
     )
     tf.keras.callbacks.Callback.__init__(self)
     self.tensor_refs_to_save_this_step = set()
     self._fetches_added = set()
     self.callable_cache = CallableCache()
     self.custom_tensors_to_save = (
         dict())  # stores tensors custom tensors saved by users every step
     self.saved_layers = dict()
     self.has_registered_model = False
Ejemplo n.º 2
0
 def __init__(
     self,
     out_dir,
     export_tensorboard=False,
     tensorboard_dir=None,
     dry_run=False,
     reduction_config=None,
     save_config=None,
     include_regex=None,
     include_collections=None,
     save_all=False,
     include_workers="one",
 ):
     TensorflowBaseHook.__init__(
         self,
         out_dir=out_dir,
         export_tensorboard=export_tensorboard,
         tensorboard_dir=tensorboard_dir,
         init_step=-1,
         dry_run=dry_run,
         reduction_config=reduction_config,
         save_config=save_config,
         include_regex=include_regex,
         include_collections=include_collections,
         save_all=save_all,
         include_workers=include_workers,
     )
     tf.keras.callbacks.Callback.__init__(self)
     self.tensor_refs_to_save_this_step = set()
     self._fetches_added = set()
     self.callable_cache = CallableCache()
Ejemplo n.º 3
0
 def __init__(
     self,
     out_dir,
     export_tensorboard=False,
     tensorboard_dir=None,
     dry_run=False,
     reduction_config=None,
     save_config=None,
     include_regex=None,
     include_collections=None,
     save_all=False,
     include_workers="one",
 ):
     TensorflowBaseHook.__init__(
         self,
         out_dir=out_dir,
         export_tensorboard=export_tensorboard,
         tensorboard_dir=tensorboard_dir,
         init_step=-1,
         dry_run=dry_run,
         reduction_config=reduction_config,
         save_config=save_config,
         include_regex=include_regex,
         include_collections=include_collections,
         save_all=save_all,
         include_workers=include_workers,
     )
     tf.keras.callbacks.Callback.__init__(self)
     self.tensor_refs_to_save_this_step = set()
     self._fetches_added = set()
     self.callable_cache = CallableCache()
     self.custom_tensors_to_save = (
         dict()
     )  # stores tensors custom tensors saved by users every step
     self.saved_layers = dict()
     self.has_registered_model = False
     # supports_tf_logs property was introduced in TF 2.3.0
     # it indicates to the framework that the callback is not
     # limited to reading only numpy logs
     self._supports_tf_logs = True
     # TF 2.3.0 has a callback ordering bug
     # this flag indicated to the train_batch_begin callback
     # the the step was already incremented in the on_train_begin callback
     self.step_incremented_in_on_train_begin = False
Ejemplo n.º 4
0
 def __init__(
     self,
     out_dir,
     export_tensorboard=False,
     tensorboard_dir=None,
     dry_run=False,
     reduction_config=None,
     save_config=None,
     include_regex=None,
     include_collections=None,
     save_all=False,
     include_workers="one",
 ):
     super().__init__(
         out_dir=out_dir,
         export_tensorboard=export_tensorboard,
         tensorboard_dir=tensorboard_dir,
         init_step=-1,
         dry_run=dry_run,
         reduction_config=reduction_config,
         save_config=save_config,
         include_regex=include_regex,
         include_collections=include_collections,
         save_all=save_all,
         include_workers=include_workers,
     )
     self._exported_collections = False
     self._exported_model = {
         ModeKeys.TRAIN: False,
         ModeKeys.EVAL: False,
         ModeKeys.PREDICT: False,
     }
     self.tensor_refs_to_save_this_step = set()
     self._fetches_added = set()
     self._prepared_tensors = {
         ModeKeys.TRAIN: False,
         ModeKeys.EVAL: False,
         ModeKeys.PREDICT: False,
     }
     self.callable_cache = CallableCache()