How to use URI_File type for running an AutoML training Job on Azure Machine Learning SDK V2

Sagar 0 Reputation points
2025-05-15T13:42:39.33+00:00

Hi Team,

I am trying to run an automl.classification training job. The training and validation files are of URI_File type. The job is failing with the following error -

Encountered user error while fetching data from Dataset. Error: UserErrorException:
	Message: Failed to download mltable yaml with error: 
Error Code: UserError
Error Message: 
Error Code: ScriptExecution.StreamAccess.NotFound
Native Error: error in streaming from input data sources
	StreamError(NotFound)
=> stream not found
	NotFound
Error Message: The requested stream was not found. Please make sure the request uri is correct.| session_id=18388af5-ad59-4506-a40e-4291d3c468c0; Not able to find MLTable file| session_id=18388af5-ad59-4506-a40e-4291d3c468c0
	InnerException None
	ErrorResponse 
{
    "error": {
        "code": "UserError",
        "message": "Failed to download mltable yaml with error: \nError Code: UserError\nError Message: \nError Code: ScriptExecution.StreamAccess.NotFound\nNative Error: error in streaming from input data sources\n\tStreamError(NotFound)\n=> stream not found\n\tNotFound\nError Message: The requested stream was not found. Please make sure the request uri is correct.| session_id=18388af5-ad59-4506-a40e-4291d3c468c0; Not able to find MLTable file| session_id=18388af5-ad59-4506-a40e-4291d3c468c0"
    }
}

Is there a way to setup the job to use the URI_file type rather than an ML Table into the training job?

Thanks & Regards,

Sagar

Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
3,335 questions
{count} votes

1 answer

Sort by: Most helpful
  1. JAYA SHANKAR G S 3,960 Reputation points Microsoft External Staff Moderator
    2025-05-20T12:44:44.5266667+00:00

    Hello @Sagar ,

    Here are the ways to create input dataset with uri_file type and pass it to auto ml classification job.

    1. As per this documentation you need to pass Input type object as training data for automl class, below is the how you create and pass it as training data to classification.
    
    my_training_data_input = Input(
    type="uri_file", 
    path="./data/training-data-folder/your_file.csv" #Paths can be local paths, remote data uris, or a registered AzureML asset ID.
    
    )
    
    
    classification_job = automl.classification(
        compute=compute_name,
        experiment_name=exp_name,
        training_data=my_training_data_input,
        target_column_name="y",
        primary_metric="accuracy",
        n_cross_validations=5,
        enable_model_explainability=True,
        tags={"my_custom_tag": "My custom value"},
    )
    
    1. In portal you can create it, follow below steps.

    User's image

    Next, give a name and select uri_file

    User's image

    Select data source and click on next.

    User's image

    According to data source add your training data files and click on create.

    User's image

    After creating use below code for creating auto ml classification object.

    data_asset = ml_client.data.get("<Name given while creating above dataset>", version="1")
    input_data = Input(path=data_asset.id)
    
    classification_job = automl.classification(
        compute=compute_name,
        experiment_name=exp_name,
        training_data=input_data ,
        target_column_name="y",
        primary_metric="accuracy",
        n_cross_validations=5,
        enable_model_explainability=True,
        tags={"my_custom_tag": "My custom value"},
    )
    

    Above are the ways to create dataset as uri file, please try it and let us know if you have any query in comments or in private chat.

    Thank you


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.