yocto-gl icon indicating copy to clipboard operation
yocto-gl copied to clipboard

[BUG]: Cannot load model from model registry

Open ammarsaf opened this issue 6 months ago • 6 comments

Issues Policy acknowledgement

  • [X] I have read and agree to submit bug reports in accordance with the issues policy

Where did you encounter this bug?

Local machine

Willingness to contribute

Yes. I can contribute a fix for this bug independently.

MLflow version

mlflow, version 2.15.0

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 22
  • Python version: 3.10
  • yarn version, if running the dev UI:

Describe the problem

I registered my model with the following code

best_run_id = best_run.run_id
model_uri = f"runs:/{best_run_id}/model"

mlflow.register_model(model_uri=model_uri, 
                      name="hotel_classifier")

What I want to do is to load the model from model registry. I execute the following code

model_name = "hotel_classifier"
model_version = 1
model_uri = f"models:/{model_name}/{model_version}"
load_model = mlflow.pyfunc.load_model(model_uri)

However it showed the following error


---------------------------------------------------------------------------


OSError: No such file or directory: '/home/User/workplace/hotel/artifact_location/0eb40601413841e78f8b7b89fbf82be7/artifacts/models/.'
Output is truncated. View as a [scrollable element](command:cellOutput.enableScrolling?6c701aca-3434-4f04-9132-93a66b72d25a) or open in a [text editor](command:workbench.action.openLargeOutput?6c701aca-3434-4f04-9132-93a66b72d25a). Adjust cell output [settings](command:workbench.action.openSettings?%5B%22%40tag%3AnotebookOutputLayout%22%5D)...

I checked my artifact directory which is /artifact_location and check the content of /0eb40601413841e78f8b7b89fbf82be7, but there is NO /artifact/model directory exist. I also has tried using alias instead of version, however it showed the same error.

I have no idea why it point towards this path.

During create experiment, I used artifact_location as my artifact directory name.

What I can do right now is load the model from runs, which not what I want. Appreciate if anyone can help. Thank you.

Tracking information

REPLACE_ME

Code to reproduce issue

REPLACE_ME

Stack trace

REPLACE_ME

Other info / logs

REPLACE_ME

What component(s) does this bug affect?

  • [X] area/artifacts: Artifact stores and artifact logging
  • [ ] area/build: Build and test infrastructure for MLflow
  • [ ] area/deployments: MLflow Deployments client APIs, server, and third-party Deployments integrations
  • [ ] area/docs: MLflow documentation pages
  • [ ] area/examples: Example code
  • [X] area/model-registry: Model Registry service, APIs, and the fluent client calls for Model Registry
  • [ ] area/models: MLmodel format, model serialization/deserialization, flavors
  • [ ] area/recipes: Recipes, Recipe APIs, Recipe configs, Recipe Templates
  • [ ] area/projects: MLproject format, project running backends
  • [ ] area/scoring: MLflow Model server, model deployment tools, Spark UDFs
  • [ ] area/server-infra: MLflow Tracking server backend
  • [ ] area/tracking: Tracking Service, tracking client APIs, autologging

What interface(s) does this bug affect?

  • [ ] area/uiux: Front-end, user experience, plotting, JavaScript, JavaScript dev server
  • [ ] area/docker: Docker use across MLflow's components, such as MLflow Projects and MLflow Models
  • [ ] area/sqlalchemy: Use of SQLAlchemy in the Tracking Service or Model Registry
  • [ ] area/windows: Windows support

What language(s) does this bug affect?

  • [ ] language/r: R APIs and clients
  • [ ] language/java: Java APIs and clients
  • [ ] language/new: Proposals for new client languages

What integration(s) does this bug affect?

  • [ ] integrations/azure: Azure and Azure ML integrations
  • [ ] integrations/sagemaker: SageMaker integrations
  • [ ] integrations/databricks: Databricks integrations

ammarsaf avatar Jul 31 '24 09:07 ammarsaf