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
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.
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 .
Know list down the runs and its status.
Above code give you the list of runs.
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.
If you find your best run and model in datastore, but still you are unable to register model.
Try below.
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.