(NoMatchingArtifactsFoundFromJob) No artifacts matching outputs/model.pt found from Job - Azure ML

311 views Asked by At

I am trying to create a regitered Azure ML Model using the the existing best model from the experiment which is run.

The documentation I have refered said we can create it via this code. but it returns a error

enter image description here

import datetime
from azure.ai.ml.entities import (
    Environment,
    BatchEndpoint,
    BatchDeployment,
    BatchRetrySettings,
    Model,
)
from azure.ai.ml.constants import BatchDeploymentOutputAction

model_name = "github-dau-tcn"
batch_endpoint_name = "gdau-batch-" + datetime.datetime.now().strftime("%m%d%H%M%f")

model = Model(
    path=f"azureml://jobs/{best_run.info.run_id}/outputs/artifacts/outputs/model.pt",
    name=model_name,
    description="some name",
)
registered_model = ml_client.models.create_or_update(model)

It seems the artifact is not stored in a specific path under azureml::

Can anyone help?

I am getting the below error:

HttpResponseError: (UserError) The request is invalid. Code: UserError Message: The request is invalid. Exception Details: (NoMatchingArtifactsFoundFromJob) No artifacts matching outputs/model.pt found from Job. Code: NoMatchingArtifactsFoundFromJob Message: No artifacts matching outputs/model.pt found from Job. Additional Information:Type: ComponentName Info: { "value": "managementfrontend" }Type: Correlation

I am trying to create a regitered Azure ML Model using the the existing best model from the experiment which is run.

1

There are 1 answers

0
JayashankarGS On

If you successfully run the job, then check the best_run exists in datastore or list down runs and see the best_run exists.

I have reproduced in my environment, and below is the best run id .

enter image description here

Know list down the runs and its status.

exp = mlflow.get_experiment_by_name("sdkv2-forecasting-github-dau")
runs = mlflow.search_runs(exp.experiment_id)
runs

Above code give you the list of runs.

runs[runs["status"]=="FINISHED"]

enter image description here

Here you can see my best run status is finished. If you see this and run the register model code, it will execute successfully.

Again, you can check this in datastore.

Got to > Datastores > workspaceartifactstore > ExperimentRun > (best run) > outputs.

enter image description here

enter image description here

If you find your best run and model in datastore, but still you are unable to register model.

Try below.

pathn1 =f"azureml://datastores/<datastore_name>/paths/<path_to_model>"
model_name = "Model_via_dataStore"
model = Model(
path=pathn1,
name=model_name,
description="Github DAU forecasting"
)
registered_model = ml_client.models.create_or_update(model)

enter image description here

If you can't find your model, then you need wait for the training to finish. In my case it took 1h 40m 30.67s to finish the job. May you need to wait or re-run your training code.

enter image description here