import tensorflow as tf

    model_name: string, a model name used inside the model server.
    image_size: int, size of image, assuming image height and width.
    batch_sizes: list, a list of batch sizes to create different input requests.
    num_requests: int, number of requests per batch size.

  Raises:
    ValueError: if batch_sizes is not a valid integer list.
  """
  if not isinstance(batch_sizes, list) or not batch_sizes:
    raise ValueError('batch sizes should be a valid non-empty list.')
  extra_assets_dir = os.path.join(savedmodel_dir, 'assets.extra')
  tf.gfile.MkDir(extra_assets_dir)
  with tf.python_io.TFRecordWriter(
      os.path.join(extra_assets_dir, 'tf_serving_warmup_requests')) as writer:
    for batch_size in batch_sizes:
      for _ in range(num_requests):
        request = predict_pb2.PredictRequest()
        image = np.uint8(np.random.rand(image_size, image_size, 3) * 255)
        request.inputs['input'].CopyFrom(
            tf.make_tensor_proto(
                [_encode_image(image)] * batch_size, shape=[batch_size]))
        request.model_spec.name = model_name
