def load_model(model_uri, **kwargs):
    '\n    Load a Keras model from a local file or a run.\n\n    Extra arguments are passed through to keras.load_model.\n\n    :param model_uri: The location, in URI format, of the MLflow model. For example:\n\n                      - ``/Users/me/path/to/local/model``\n                      - ``relative/path/to/local/model``\n                      - ``s3://my_bucket/path/to/model``\n                      - ``runs:/<mlflow_run_id>/run-relative/path/to/model``\n                      - ``models:/<model_name>/<model_version>``\n                      - ``models:/<model_name>/<stage>``\n\n                      For more information about supported URI schemes, see\n                      `Referencing Artifacts <https://www.mlflow.org/docs/latest/concepts.html#\n                      artifact-locations>`_.\n\n    :return: A Keras model instance.\n\n    .. code-block:: python\n        :caption: Example\n\n        # Load persisted model as a Keras model or as a PyFunc, call predict() on a pandas DataFrame\n        keras_model = mlflow.keras.load_model("runs:/96771d893a5e46159d9f3b49bf9013e2" + "/models")\n        predictions = keras_model.predict(x_test)\n    '
    local_model_path = _download_artifact_from_uri(artifact_uri=model_uri)
    flavor_conf = _get_flavor_configuration(model_path=local_model_path, flavor_name=FLAVOR_NAME)
    keras_module = importlib.import_module(flavor_conf.get('keras_module', 'keras'))
    keras_model_artifacts_path = os.path.join(local_model_path, flavor_conf.get('data', _MODEL_SAVE_PATH))
    return _load_model(model_path=keras_model_artifacts_path, keras_module=keras_module, **kwargs)
Load a Keras model from a local file or a run.

Extra arguments are passed through to keras.load_model.

:param model_uri: The location, in URI format, of the MLflow model. For example:

                  - ``/Users/me/path/to/local/model``
                  - ``relative/path/to/local/model``
                  - ``s3://my_bucket/path/to/model``
                  - ``runs:/<mlflow_run_id>/run-relative/path/to/model``
                  - ``models:/<model_name>/<model_version>``
                  - ``models:/<model_name>/<stage>``

                  For more information about supported URI schemes, see
                  `Referencing Artifacts <https://www.mlflow.org/docs/latest/concepts.html#
                  artifact-locations>`_.

:return: A Keras model instance.

.. code-block:: python
    :caption: Example

    # Load persisted model as a Keras model or as a PyFunc, call predict() on a pandas DataFrame
    keras_model = mlflow.keras.load_model("runs:/96771d893a5e46159d9f3b49bf9013e2" + "/models")
    predictions = keras_model.predict(x_test)
def load_model(model_uri, **kwargs):
    '\n    Load a Keras model from a local file or a run.\n\n    Extra arguments are passed through to keras.load_model.\n\n    :param model_uri: The location, in URI format, of the MLflow model. For example:\n\n                      - ``/Users/me/path/to/local/model``\n                      - ``relative/path/to/local/model``\n                      - ``s3://my_bucket/path/to/model``\n                      - ``runs:/<mlflow_run_id>/run-relative/path/to/model``\n                      - ``models:/<model_name>/<model_version>``\n                      - ``models:/<model_name>/<stage>``\n\n                      For more information about supported URI schemes, see\n                      `Referencing Artifacts <https://www.mlflow.org/docs/latest/concepts.html#\n                      artifact-locations>`_.\n\n    :return: A Keras model instance.\n\n    .. code-block:: python\n        :caption: Example\n\n        # Load persisted model as a Keras model or as a PyFunc, call predict() on a pandas DataFrame\n        keras_model = mlflow.keras.load_model("runs:/96771d893a5e46159d9f3b49bf9013e2" + "/models")\n        predictions = keras_model.predict(x_test)\n    '
    local_model_path = _download_artifact_from_uri(artifact_uri=model_uri)
    flavor_conf = _get_flavor_configuration(model_path=local_model_path, flavor_name=FLAVOR_NAME)
    keras_module = importlib.import_module(flavor_conf.get('keras_module', 'keras'))
    keras_model_artifacts_path = os.path.join(local_model_path, flavor_conf.get('data', _MODEL_SAVE_PATH))
    return _load_model(model_path=keras_model_artifacts_path, keras_module=keras_module, **kwargs)