I have a folder in a blob storage with training data for an experiment but when I run the script for training with
import azureml.core
from azureml.core.workspace import Workspace
from azureml.core import Environment
from azureml.core.environment import CondaDependencies
from azureml.core import ScriptRunConfig, Experiment
from azure.ai.ml import MLClient
from azureml.core.workspace import Workspace
from azure.identity import DefaultAzureCredential
from azureml.core import Dataset
from azure.ai.ml.constants import AssetTypes
from azure.ai.ml import command, Input
ws = Workspace.from_config()
ml_client = MLClient.from_config(credential=DefaultAzureCredential())
dataSet = Dataset.File.from_files(['https://<filepath>])
dataSet = dataSet.as_named_input('data_path').as_download()
myexp = Experiment(workspace=ws, name = "Yolo-experiment")
curated_env = Environment.get(workspace=ws, name="AzureML-ACPT-pytorch-1.11-py38-cuda11.3-gpu")
config = ScriptRunConfig(source_directory=".",
script="resnet18-trainer.py",
compute_target="local",
environment=curated_env,
arguments=[dataSet]
)
run = myexp.submit(config=config)
I get a
Failed to extract subscription information, Exception=AttributeError; 'Logger' object has no attribute 'activity_info'
error that pops up 8 times, and while the job starts, it hangs for a few minutes before dying.
The error message seems to be caused by the myexp.submit() line, but there is no stack trace or explanation of why this is happening.
Was expecting it to pass the temporary file path of the downloaded data asset to my script. I have tried installing the pip package that is referenced in AttributeError in Azure ML: 'Logger' object has no attribute 'activity_info' during Dataset Registration and the azure-ml-api-sdk pip package referenced in https://learn.microsoft.com/en-us/answers/questions/377203/error-while-accessing-the-dataset-from-a-datastore but neither has helped I referenced https://learn.microsoft.com/en-us/answers/questions/1242662/i-am-having-trouble-accessing-the-datastore-data but it seems the same
I have reproduced the scenario but didn't get any error. The error you are getting is might be caused by a bug in the older version of Azure ML SDK. Below are the possible solution you can try:
pip install --upgrade azureml-sdk
Ensure that you have the proper permissions to access the blob storage, check the settings for your Azure subscription. ref:https://learn.microsoft.com/en-us/azure/machine-learning/v1/how-to-connect-data-ui?view=azureml-api-1&tabs=credential
Try running your script in different environment:
You can try running your script in a azure "remote compute"
rather than "local"
.
ref: https://learn.microsoft.com/en-us/azure/machine-learning/how-to-create-manage-compute-instance?view=azureml-api-2&tabs=python
Below is the output: