code: def init_object_detector_graph(self, input_h, input_w, init_weights):
      _tf = _lazy_import_tensorflow()
  
      def ClipIfNotNone(grad, clip_value):
          """
          Function to check if grad value is None. If not, continue with clipping.
          """
          if grad is None:
              return grad
          return _tf.clip_by_value(grad, -clip_value, clip_value)
  
      self.is_train = _tf.placeholder(
          _tf.bool
      )  # Set flag for training or val
  
      # Create placeholders for image and labels
      self.images = _tf.placeholder(
          _tf.float32,
          [self.batch_size, input_h, input_w, 3],
          name="images",
      )
      self.labels = _tf.placeholder(
          _tf.float32,
          [
              self.batch_size,
              self.grid_shape[0],
              self.grid_shape[1],
              self.num_anchors,
              self.num_classes + 5,
          ],
          name="labels",
      )
  
      self.tf_model = self.tiny_yolo(self.images, init_weights)
      self.global_step = _tf.Variable(
          0, trainable=False, name="global_step"
      )
  
      self.loss = self.loss_layer(self.tf_model, self.labels)
      self.base_lr = _utils.convert_shared_float_array_to_numpy(
          self.config["learning_rate"]
      )
      self.num_iterations = int(
          _utils.convert_shared_float_array_to_numpy(
              self.config["num_iterations"]
          )
      )
      self.init_steps = [
          self.num_iterations // 2,
          3 * self.num_iterations // 4,
          self.num_iterations,
      ]
      self.lrs = [
          _np.float32(self.base_lr * 10 ** (-i))
          for i, step in enumerate(self.init_steps)
      ]
      self.steps_tf = self.init_steps[:-1]
      self.lr = _tf.train.piecewise_constant(
          self.global_step, self.steps_tf, self.lrs
      )
      # TODO: Evaluate method to update lr in set_learning_rate()
  
      self.opt = _tf.train.MomentumOptimizer(self.lr, momentum=0.9)
  
      self.clip_value = _utils.convert_shared_float_array_to_numpy(
          self.config.get("gradient_clipping")
      )
  
      grads_and_vars = self.opt.compute_gradients(self.loss)
      clipped_gradients = [
          (ClipIfNotNone(g, self.clip_value), v)
          for g, v in grads_and_vars
      ]
      self.train_op = self.opt.apply_gradients(
          clipped_gradients, global_step=self.global_step
      )
  
      self.sess.run(_tf.global_variables_initializer())
      self.sess.run(_tf.local_variables_initializer())
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import numpy
  from .._tf_model import TensorFlowModel
  from turicreate._deps.minimal_package import _minimal_package_import_check
  import turicreate.toolkits._tf_utils
label_desc: Use image node_id 2 for calling the ODTensorFlowModel obj's underlying member method code with example usage: obj.init_object_detector_graph(input_h, input_w, init_weights) and returns: _tf, grad