Reputation: 221
I'm trying to serve a model locally as a REST endpoint using MLFlow CLI. MLflow version is 2.11.3. Following are the arguments that I'm using.
mlflow models serve -m "runs:/7782c4a700cc49c1a04f9ce608d90358/knnmodel" --env-manager local --port 5000
Following is the exception:
Traceback (most recent call last):
File "/home/vagrant/.local/bin/mlflow", line 8, in <module>
sys.exit(cli())
File "/home/vagrant/.local/lib/python3.8/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
File "/home/vagrant/.local/lib/python3.8/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
File "/home/vagrant/.local/lib/python3.8/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/vagrant/.local/lib/python3.8/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/vagrant/.local/lib/python3.8/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/vagrant/.local/lib/python3.8/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "/home/vagrant/.local/lib/python3.8/site-packages/mlflow/models/cli.py", line 104, in serve
return get_flavor_backend(
File "/home/vagrant/.local/lib/python3.8/site-packages/mlflow/models/flavor_backend_registry.py", line 44, in get_flavor_backend
local_path = _download_artifact_from_uri(
File "/home/vagrant/.local/lib/python3.8/site-packages/mlflow/tracking/artifact_utils.py", line 105, in _download_artifact_from_uri
return get_artifact_repository(artifact_uri=root_uri).download_artifacts(
File "/home/vagrant/.local/lib/python3.8/site-packages/mlflow/store/artifact/artifact_repository_registry.py", line 124, in get_artifact_repository
return _artifact_repository_registry.get_artifact_repository(artifact_uri)
File "/home/vagrant/.local/lib/python3.8/site-packages/mlflow/store/artifact/artifact_repository_registry.py", line 77, in get_artifact_repository
return repository(artifact_uri)
File "/home/vagrant/.local/lib/python3.8/site-packages/mlflow/store/artifact/runs_artifact_repo.py", line 27, in __init__
self.repo = get_artifact_repository(uri)
File "/home/vagrant/.local/lib/python3.8/site-packages/mlflow/store/artifact/artifact_repository_registry.py", line 124, in get_artifact_repository
return _artifact_repository_registry.get_artifact_repository(artifact_uri)
File "/home/vagrant/.local/lib/python3.8/site-packages/mlflow/store/artifact/artifact_repository_registry.py", line 77, in get_artifact_repository
return repository(artifact_uri)
File "/home/vagrant/.local/lib/python3.8/site-packages/mlflow/store/artifact/mlflow_artifacts_repo.py", line 45, in __init__
super().__init__(self.resolve_uri(artifact_uri, get_tracking_uri()))
File "/home/vagrant/.local/lib/python3.8/site-packages/mlflow/store/artifact/mlflow_artifacts_repo.py", line 59, in resolve_uri
_validate_uri_scheme(track_parse.scheme)
File "/home/vagrant/.local/lib/python3.8/site-packages/mlflow/store/artifact/mlflow_artifacts_repo.py", line 35, in _validate_uri_scheme
raise MlflowException(
mlflow.exceptions.MlflowException: The configured tracking uri scheme: 'file' is invalid for use with the proxy mlflow-artifact scheme. The allowed tracking schemes are: {'https', 'http'}
It seems like MLflow the artefact cannot be accessed from the MLflow Webserver. Any fixed for this?
Upvotes: 0
Views: 975
Reputation: 1
you need to export this variable
export MLFLOW_TRACKING_URI=http://127.0.0.1:<PORT of the mlflow server>
Upvotes: 0