Commit fe4e6b65 authored by Hongkun Yu's avatar Hongkun Yu Committed by A. Unique TensorFlower
Browse files

Internal change

PiperOrigin-RevId: 311626933
parent 3dccfae1
...@@ -117,7 +117,8 @@ def get_callbacks( ...@@ -117,7 +117,8 @@ def get_callbacks(
if FLAGS.enable_tensorboard: if FLAGS.enable_tensorboard:
tensorboard_callback = tf.keras.callbacks.TensorBoard( tensorboard_callback = tf.keras.callbacks.TensorBoard(
log_dir=FLAGS.model_dir) log_dir=FLAGS.model_dir,
profile_batch=FLAGS.profile_steps)
callbacks.append(tensorboard_callback) callbacks.append(tensorboard_callback)
is_pruning_enabled = pruning_method is not None is_pruning_enabled = pruning_method is not None
...@@ -228,6 +229,14 @@ def define_keras_flags( ...@@ -228,6 +229,14 @@ def define_keras_flags(
flags.DEFINE_boolean( flags.DEFINE_boolean(
name='enable_tensorboard', default=False, name='enable_tensorboard', default=False,
help='Whether to enable Tensorboard callback.') help='Whether to enable Tensorboard callback.')
flags.DEFINE_string(
name='profile_steps', default=None,
help='Save profiling data to model dir at given range of global steps. The '
'value must be a comma separated pair of positive integers, specifying '
'the first and last step to profile. For example, "--profile_steps=2,4" '
'triggers the profiler to process 3 steps, starting from the 2nd step. '
'Note that profiler has a non-trivial performance overhead, and the '
'output file can be gigantic if profiling many steps.')
flags.DEFINE_integer( flags.DEFINE_integer(
name='train_steps', default=None, name='train_steps', default=None,
help='The number of steps to run for training. If it is larger than ' help='The number of steps to run for training. If it is larger than '
......
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