When starting azure ml experiment I get a failed to extract subscription information error

Edward Carlson 20 Reputation points
2023-05-20T02:23:14.9233333+00:00

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, there is no stack trace or explanation of why this is happening. I have found other posts saying to install the azure-ml-api-sdk pip package, however this has not fixed it for me.

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

Accepted answer
  1. VasimTamboli 4,410 Reputation points
    2023-05-20T04:31:28.24+00:00

    The error message you're encountering, "Failed to extract subscription information, Exception=AttributeError; 'Logger' object has no attribute 'activity_info'," suggests an issue with extracting subscription information in Azure Machine Learning. Here are a few troubleshooting steps you can try:

    1. Update Azure ML SDK: Ensure that you have the latest version of the Azure ML SDK installed. You can use the following command to update the Azure ML SDK:
    css
    
    pip install --upgrade azureml-sdk
    

    Verify authentication: Double-check that your authentication credentials are properly set up. Make sure you have logged in and authenticated correctly using the Azure CLI or another appropriate method.

    Check workspace configuration: Verify that your Azure Machine Learning workspace is correctly configured. Ensure that you have the correct subscription associated with your workspace and that you have the necessary permissions to access the resources.

    Check network connectivity: Ensure that you have a stable network connection and can access the necessary endpoints. Network connectivity issues could result in errors during authentication or when extracting subscription information.

    Review workspace configuration files: Check the configuration files associated with your workspace, such as the config.json file. Verify that the file contains the correct subscription and workspace details.

    Review dependencies: Confirm that you have installed all the necessary dependencies for your script, including the required Azure ML SDK packages. Ensure that you have the azureml-core package installed.

    If the issue persists after trying these steps, it would be helpful to provide more details about your environment, such as the versions of the Azure ML SDK and other relevant packages you are using. Additionally, reviewing the complete error message and any available logs or stack traces might provide further insights into the root cause of the issue.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Ramr-msft 17,616 Reputation points
    2023-05-25T08:44:18.8233333+00:00

    Thanks for the details. There was an error while trying to extract subscription information. The error message suggests that there is an AttributeError with the 'Logger' object not having the attribute 'activity_info'. This could be due to a missing or incorrect import statement or a typo in the code.

    There is typo in the following line, Could you please fix and try.

    dataSet = Dataset.File.from_files(['https://<filepath>])

    0 comments No comments