def run_executer(params, train_input_shapes=None, eval_input_shapes=None, train_input_fn=None, eval_input_fn=None):
    'Runs Mask RCNN model on distribution strategy defined by the user.'
    executer = tpu_executor.TPUEstimatorExecuter(unet_model.unet_model_fn, params, train_input_shapes=train_input_shapes, eval_input_shapes=eval_input_shapes)
    if (FLAGS.mode == 'train'):
        assert (train_input_fn is not None)
        results = executer.train(train_input_fn)
    elif (FLAGS.mode == 'eval'):
        assert (eval_input_fn is not None)
        results = executer.evaluate(eval_input_fn)
    elif (FLAGS.mode == 'train_and_eval'):
        assert (train_input_fn is not None)
        assert (eval_input_fn is not None)
        results = executer.train_and_eval(train_input_fn, eval_input_fn)
    else:
        raise ValueError('Mode must be one of `train`, `eval`, or `train_and_eval`')
    return results
Runs Mask RCNN model on distribution strategy defined by the user.
def run_executer(params, train_input_shapes=None, eval_input_shapes=None, train_input_fn=None, eval_input_fn=None):
    
    executer = tpu_executor.TPUEstimatorExecuter(unet_model.unet_model_fn, params, train_input_shapes=train_input_shapes, eval_input_shapes=eval_input_shapes)
    if (FLAGS.mode == 'train'):
        assert (train_input_fn is not None)
        results = executer.train(train_input_fn)
    elif (FLAGS.mode == 'eval'):
        assert (eval_input_fn is not None)
        results = executer.evaluate(eval_input_fn)
    elif (FLAGS.mode == 'train_and_eval'):
        assert (train_input_fn is not None)
        assert (eval_input_fn is not None)
        results = executer.train_and_eval(train_input_fn, eval_input_fn)
    else:
        raise ValueError('Mode must be one of `train`, `eval`, or `train_and_eval`')
    return results