def METHOD_NAME(model_dir, save_file,
                  model_filename=None,
                  params_filename=None,
                  enable_caffe_custom=True):
    try:
        import paddle
    except:
        logging.error(
            "paddlepaddle not installed, use \"pip install paddlepaddle\"")
    v0, v1, v2 = paddle.__version__.split('.')
    if v0 == '0' and v1 == '0' and v2 == '0':
        logging.warning("You are use develop version of paddlepaddle")
    elif int(v0) <= 1 and int(v1) < 8:
        raise ImportError("paddlepaddle>=1.8.0 is required")
    import paddle2caffe as p2c
    # convert model save with 'paddle.fluid.io.save_inference_model'
    if hasattr(paddle, 'enable_static'):
        paddle.enable_static()
    exe = fluid.Executor(fluid.CPUPlace())
    if model_filename is None and params_filename is None:
        [program, feed_var_names, fetch_vars] = fluid.io.load_inference_model(
            model_dir, exe)
    else:
        [program, feed_var_names, fetch_vars] = fluid.io.load_inference_model(
            model_dir,
            exe,
            model_filename=model_filename,
            params_filename=params_filename)
    # add temp tensor into output
    # extra_name_list = []
    # global_block = program.global_block()
    # fetch_vars = fetch_extra_vars(global_block, fetch_vars, extra_name_list)
    p2c.METHOD_NAME(
        program,
        fluid.global_scope(),
        model_dir,
        save_file,
        feed_var_names=feed_var_names,
        target_vars=fetch_vars,
        use_caffe_custom=enable_caffe_custom)