Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to download a trained model using azure-ai-ml version 1.22.2 #38609

Closed
MrKriss opened this issue Nov 19, 2024 · 1 comment · Fixed by #38635 or #38634
Closed

Unable to download a trained model using azure-ai-ml version 1.22.2 #38609

MrKriss opened this issue Nov 19, 2024 · 1 comment · Fixed by #38635 or #38634
Assignees
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Machine Learning needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.

Comments

@MrKriss
Copy link

MrKriss commented Nov 19, 2024

  • Package Name: azure-ai-ml
  • Package Version: 1.22.2
  • Operating System: Ubuntu (via WSL)
  • Python Version: 3.12

Describe the bug
Unable to download a trained model using the python SDK. The following error is raised in the SDK
internals

AttributeError("'SasDatastoreSecrets' object has no attribute 'key'")

To Reproduce
Steps to reproduce the behavior:

  1. Train a model using azure-ai-ml version 1.22.2
  2. Connect to the workspace and create a MLClient object.
  3. Call client.models.download(...) giving the details of the just trained model.

Expected behavior
The model is downloaded successfully

Screenshots
The traceback is shown below

Encountered exception during execution: AttributeError("'SasDatastoreSecrets' object has no attribute 'key'")
Traceback (most recent call last):
  File "/opt/python/packages/my_package/inference.py", line 31, in download_model
    aml.client.models.download(
  File "/opt/python/packages/azure/ai/ml/_telemetry/activity.py", line 292, in wrapper
    return f(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^
  File "/opt/python/packages/azure/ai/ml/operations/_model_operations.py", line 404, in download
    ds = self._datastore_operation.get(ds_name, include_secrets=True)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/python/packages/azure/ai/ml/_telemetry/activity.py", line 292, in wrapper
    return f(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^
  File "/opt/python/packages/azure/ai/ml/operations/_datastore_operations.py", line 163, in get
    return Datastore._from_rest_object(datastore_resource)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/python/packages/azure/ai/ml/entities/_datastore/datastore.py", line 191, in _from_rest_object
    res_abd: Datastore = AzureBlobDatastore._from_rest_object(datastore_resource)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/python/packages/azure/ai/ml/entities/_datastore/azure_storage.py", line 207, in _from_rest_object
    credentials=from_rest_datastore_credentials(properties.credentials),  # type: ignore[arg-type]
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/python/packages/azure/ai/ml/entities/_datastore/utils.py", line 53, in from_rest_datastore_credentials
    config_class._from_datastore_rest_object(rest_credentials),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/python/packages/azure/ai/ml/entities/_credentials.py", line 130, in _from_datastore_rest_object
    return cls(account_key=obj.secrets.key if obj.secrets else None)
                           ^^^^^^^^^^^^^^^
AttributeError: 'SasDatastoreSecrets' object has no attribute 'key'

Additional context

@github-actions github-actions bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Nov 19, 2024
@xiangyan99 xiangyan99 added Machine Learning Service Attention Workflow: This issue is responsible by Azure service team. and removed needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. labels Nov 19, 2024
@github-actions github-actions bot added the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Nov 19, 2024
Copy link

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Azure/azure-ml-sdk @azureml-github.

@achauhan-scc achauhan-scc self-assigned this Nov 21, 2024
@achauhan-scc achauhan-scc linked a pull request Nov 21, 2024 that will close this issue
6 tasks
@achauhan-scc achauhan-scc removed a link to a pull request Nov 21, 2024
6 tasks
This was linked to pull requests Nov 21, 2024
achauhan-scc added a commit that referenced this issue Nov 21, 2024
l0lawrence pushed a commit to l0lawrence/azure-sdk-for-python that referenced this issue Feb 19, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Feb 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
customer-reported Issues that are reported by GitHub users external to the Azure organization. Machine Learning needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team.
Projects
None yet
3 participants