Can't make an online and local deployment in Azure ML - Must provide either version or label - Stack Overflow

admin2025-04-17  0

Hi I'm trying to publish my model to the public, unfortunately azure ml has a different opinion. The error that I'm getting is when trying to publish it locally first, with the following command:

blue_deployment = ManagedOnlineDeployment(
    name="yolo11-retail-ocr-2-v8",
    endpoint_name=endpoint_name,
    model=model_asset_name,
    instance_type="Standard_E16s_v3",
    instance_count=1,
    environment=env,
    scoring_script="score-copy.py",
    code_path='./YOLO11 Finetuned Model'
)

ml_client.online_deployments.begin_create_or_update(blue_deployment, local=True)

First I'm getting

Creating local deployment (hf-ep-1740504777 / yolo11-retail-ocr-2-v8) .Done (0m 5s)

And after that the error appreas:

ValidationException: (x) Must provide either version or label

Which is odd as I have a registered model with a version attached to it. I have a workng custom environment and an endpoint.

Hi I'm trying to publish my model to the public, unfortunately azure ml has a different opinion. The error that I'm getting is when trying to publish it locally first, with the following command:

blue_deployment = ManagedOnlineDeployment(
    name="yolo11-retail-ocr-2-v8",
    endpoint_name=endpoint_name,
    model=model_asset_name,
    instance_type="Standard_E16s_v3",
    instance_count=1,
    environment=env,
    scoring_script="score-copy.py",
    code_path='./YOLO11 Finetuned Model'
)

ml_client.online_deployments.begin_create_or_update(blue_deployment, local=True)

First I'm getting

Creating local deployment (hf-ep-1740504777 / yolo11-retail-ocr-2-v8) .Done (0m 5s)

And after that the error appreas:

ValidationException: (x) Must provide either version or label

Which is odd as I have a registered model with a version attached to it. I have a workng custom environment and an endpoint.

Share Improve this question edited Mar 9 at 6:03 default_settings asked Mar 8 at 20:15 default_settingsdefault_settings 5181 gold badge5 silver badges11 bronze badges 1
  • Hi, how you are giving model_asset_name? Please add that. – JayashankarGS Commented Mar 10 at 12:47
Add a comment  | 

1 Answer 1

Reset to default 1

The error you are getting because of the model you are passing.

Either you need to pass model object

model = Model(...)
blue_deployment = ManagedOnlineDeployment(
    name="blue",
    endpoint_name=endpoint_name,
    model=model,
    environment=env,
    code_configuration=CodeConfiguration(
        code="../model-1/onlinescoring", scoring_script="score.py"
    ),
    instance_type="Standard_DS3_v2",
    instance_count=1,
)

or string with model name and version like below.

blue_deployment = ManagedOnlineDeployment(
    name="blue",
    endpoint_name=endpoint_name,
    model="<model_name:version>",#health_classifier:1
    environment=env,
    code_configuration=CodeConfiguration(
        code="../model-1/onlinescoring", scoring_script="score.py"
    ),
    instance_type="Standard_DS3_v2",
    instance_count=1,
)

Please refer this for more information on parameter to managed online deployment.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1744885857a272529.html

最新回复(0)