0

I am trying to set up and run an ML pipeline on Azure ML studio. I created the pipeline and got a REST endpoint published for it. When I run the pipeline endpoint using the UI, it works as expected.

I am trying to get it to run using the python SDK as well using the following code -

cli_auth = AzureCliAuthentication()
ws = Workspace(subscription_id="<SUBSCRIPTION-ID>",
               resource_group="<RESOURCE-NAME>",
               workspace_name="<WORKSPACE-NAME>",
               auth=cli_auth)
pipeline_endpoint = PipelineEndpoint.get(workspace=ws, name="PIPELINE-NAME")
run_id = pipeline_endpoint.submit("SomeOtherExp", pipeline_parameters={"img_tr_text_input": "Some other input"})
print(run_id)

This gets the pipeline to trigger, but the pipeline parameter that I am passing in is not the one that the pipeline gets. Within the pipeline I am simply printing out the pipeline parameter, and it's printing out the default one that I have set up using the UI.

The way I have set up the default pipeline parameter using the UI is as follows. enter image description here

Within the pipeline, I am simply printing the input passed to the component.

import os
import argparse

if __name__ == "__main__":
    parser = argparse.ArgumentParser()
    parser.add_argument('--text_input', type=str)
    args = parser.parse_args()

    print(f'Text: {os.path.basename(args.text_input)}')

What could be the reason why the pipeline is not accepting the parameter values specified in python?

Ananda
  • 2,925
  • 5
  • 22
  • 45
  • Can you try changing the key in your pipeline parameter dictionary from "img_tr_text_input" to "text_input" and see if that resolves the issue. So your code would look like this: run_id = pipeline_endpoint.submit("SomeOtherExp", pipeline_parameters={"text_input": "Some other input"}) – Ram Mar 30 '23 at 07:56

0 Answers0