class_docstr: Callback for auto-logging parameters and metrics in TensorFlow >= 2.0.0.
  Records model structural information as params when training starts.
class_docstr_tok: ["Callback","for","auto-logging","parameters","and","metrics","in","TensorFlow",">","=","2.0.0",".","Records","model","structural","information","as","params","when","training","starts","."]
code: def on_train_begin(
      self, logs=None
  ):  # pylint: disable=unused-argument
      config = self.model.optimizer.get_config()
      for attribute in config:
          mlflow.log_param("opt_" + attribute, config[attribute])
  
      model_summary = []
  
      def print_fn(line, *args, **kwargs):
          model_summary.append(line)
  
      try:
          self.model.summary(print_fn=print_fn)
          summary = "\n".join(model_summary)
          mlflow.log_text(summary, artifact_file="model_summary.txt")
      except ValueError as ex:
          if "This model has not yet been built" in str(ex):
              warnings.warn(str(ex))
          else:
              raise ex
  
imports: import warnings
  from typing import Dict, Union
  import numpy
  import tensorflow
  from tensorflow.keras.callbacks import Callback, TensorBoard
  import mlflow
  from mlflow.utils.autologging_utils import INPUT_EXAMPLE_SAMPLE_ROWS, ExceptionSafeClass
label_desc: Use image node_id 4 for calling the __MLflowTfKeras2Callback obj's underlying member method code with example usage: obj.on_train_begin(logs) without return types