docstr: :param model: a compiled keras model
docstr_tok: [":","param","model",":","a","compiled","keras","model"]
code: def __init__(self, model, model_dir=None, optimizer=None):
      """
      :param model: a compiled keras model
      """
      self.model = model
      self.model_dir = model_dir
      self.optimizer = optimizer
      import tensorflow as tf
  
      self.real_batch_size = tf.shape(self.model.inputs[0])[0]
      self.metric_tensors = {}
  
imports: import numpy
  from bigdl.optim.optimizer import MaxEpoch
  from zoo.tfpark.utils import evaluate_string_metrics
  from zoo.common import enable_multi_fs_save, enable_multi_fs_load
  from zoo.common.nncontext import getOrCreateSparkContext
  from zoo.tfpark.tf_dataset import TFNdarrayDataset, TFDataset, _standarize_feature_label_dataset, check_data_compatible
  from zoo.tfpark.tf_optimizer import TFOptimizer
  from zoo.tfpark.tf_predictor import TFPredictor
label_desc: Use image node_id 1 to create a new KerasModel object from inherited base classes: object with example: obj = KerasModel(model, model_dir, optimizer)