azure-sdk-for-python icon indicating copy to clipboard operation
azure-sdk-for-python copied to clipboard

AzureML OutputFileDatasetConfig not useable with destination set

Open DominiqueLade opened this issue 5 years ago • 11 comments

  • Package Name: azureml-core
  • Package Version: 1.21.0.post1
  • Operating System: MacOS
  • Python Version: 3.7.4

Describe the bug I am not able to use OutputFileDatasetConfig with a destination pointing to a Blobstorage or DataLake Gen 2.

The following error is raised:

File "/.venv/lib/python3.7/site-packages/azureml/data/output_dataset_config.py", line 459, in to_data_location 
datastore_name = destination[0].name

TypeError: 'AzureBlobDatastore' object is not subscriptable

To Reproduce Steps to reproduce the behavior:

# Connect to Azure ML
interactive_auth = InteractiveLoginAuthentication(tenant_id=tenant_id)
ws = Workspace(subscription_id, resource_group, workspace_name, auth=interactive_auth)
experiment = Experiment(workspace=ws, name="test-experiment")

# Get Dataset
my-output-dataset = OutputFileDatasetConfig(name="attachments", destination=ws.datastores["my-datastore"])

# Set Run Config
pipeline_path = Path(__file__).parent.absolute()
config = ScriptRunConfig(
    source_directory='./',
    script="my-script.py",
    compute_target="default-compute-target",
    arguments=[
        "--path",
        my-output-dataset.as_mount(),
    ],
)

# Execute Script
run = experiment.submit(config)

Expected behavior Mount Blobstorage and Datalake Gen 2 as output dataset to a compute target

Screenshots

Additional context

DominiqueLade avatar Jan 27 '21 10:01 DominiqueLade

Hi,

unfortunately, I still have the same issue as described above. This is currently a show stopper for us.

Is this the right place to fill the bug report? Is anyone investigating this?

DominiqueLade avatar Feb 03 '21 08:02 DominiqueLade

We tried to do this as well, and it didn't work for us either. You can use File Share, which will return a result, but we found other bugs even when we found a workaround for this.

yeamusic21 avatar Feb 05 '21 16:02 yeamusic21

@yeamusic21 Thanks for sharing your insights. Do you mind to elaborate a bit about the other bugs?

DominiqueLade avatar Feb 08 '21 07:02 DominiqueLade

@DominiqueLade - https://github.com/Azure/azure-sdk-for-python/issues/16568

Also, https://stackoverflow.com/questions/65240603/azure-ml-studio-ml-pipeline-exception-no-temp-file-found

yeamusic21 avatar Feb 08 '21 14:02 yeamusic21

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

Issue Details
  • Package Name: azureml-core
  • Package Version: 1.21.0.post1
  • Operating System: MacOS
  • Python Version: 3.7.4

Describe the bug I am not able to use OutputFileDatasetConfig with a destination pointing to a Blobstorage or DataLake Gen 2.

The following error is raised:

File "/.venv/lib/python3.7/site-packages/azureml/data/output_dataset_config.py", line 459, in to_data_location 
datastore_name = destination[0].name

TypeError: 'AzureBlobDatastore' object is not subscriptable

To Reproduce Steps to reproduce the behavior:

# Connect to Azure ML
interactive_auth = InteractiveLoginAuthentication(tenant_id=tenant_id)
ws = Workspace(subscription_id, resource_group, workspace_name, auth=interactive_auth)
experiment = Experiment(workspace=ws, name="test-experiment")

# Get Dataset
my-output-dataset = OutputFileDatasetConfig(name="attachments", destination=ws.datastores["my-datastore"])

# Set Run Config
pipeline_path = Path(__file__).parent.absolute()
config = ScriptRunConfig(
    source_directory='./',
    script="my-script.py",
    compute_target="default-compute-target",
    arguments=[
        "--path",
        my-output-dataset.as_mount(),
    ],
)

# Execute Script
run = experiment.submit(config)

Expected behavior Mount Blobstorage and Datalake Gen 2 as output dataset to a compute target

Screenshots

Additional context

Author: DominiqueLade
Assignees: -
Labels:

Client, Machine Learning, Service Attention, bug, customer-reported, needs-triage, question

Milestone: -

ghost avatar Feb 09 '21 00:02 ghost

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

Issue Details
  • Package Name: azureml-core
  • Package Version: 1.21.0.post1
  • Operating System: MacOS
  • Python Version: 3.7.4

Describe the bug I am not able to use OutputFileDatasetConfig with a destination pointing to a Blobstorage or DataLake Gen 2.

The following error is raised:

File "/.venv/lib/python3.7/site-packages/azureml/data/output_dataset_config.py", line 459, in to_data_location 
datastore_name = destination[0].name

TypeError: 'AzureBlobDatastore' object is not subscriptable

To Reproduce Steps to reproduce the behavior:

# Connect to Azure ML
interactive_auth = InteractiveLoginAuthentication(tenant_id=tenant_id)
ws = Workspace(subscription_id, resource_group, workspace_name, auth=interactive_auth)
experiment = Experiment(workspace=ws, name="test-experiment")

# Get Dataset
my-output-dataset = OutputFileDatasetConfig(name="attachments", destination=ws.datastores["my-datastore"])

# Set Run Config
pipeline_path = Path(__file__).parent.absolute()
config = ScriptRunConfig(
    source_directory='./',
    script="my-script.py",
    compute_target="default-compute-target",
    arguments=[
        "--path",
        my-output-dataset.as_mount(),
    ],
)

# Execute Script
run = experiment.submit(config)

Expected behavior Mount Blobstorage and Datalake Gen 2 as output dataset to a compute target

Screenshots

Additional context

Author: DominiqueLade
Assignees: -
Labels:

Client, Machine Learning, Service Attention, bug, customer-reported, needs-triage, question

Milestone: -

ghost avatar Feb 09 '21 00:02 ghost

Hi @DominiqueLade The destination parameter requires a tuple, so, you should specify it to something like this: my-output-dataset = OutputFileDatasetConfig(name="attachments", destination=(ws.datastores["my-datastore"], "/output/{run-id}/{output-name}"))

ChunyuMSFT avatar Feb 18 '21 00:02 ChunyuMSFT

Thanks for the clarification!

Might be a good idea to improve the error messages.

DominiqueLade avatar Feb 18 '21 07:02 DominiqueLade

Thanks @DominiqueLade - please reopen this issue if you have any further questions #please-close

meyetman avatar Mar 05 '21 19:03 meyetman

Hi , I have an issue similar to this one. When I want to connect to blobstorage (following code) in AML I get the following error :

from azureml.data import OutputFileDatasetConfig ws = Workspace.from_config() output = OutputFileDatasetConfig(destination=(blob_datastore, 'unzip'))

TypeError: expected str, bytes or os.PathLike object, not OutputFileDatasetConfig

I am following the reference "https://docs.microsoft.com/en-us/azure/machine-learning/how-to-train-with-datasets#mount-vs-download"

  • azureml.core 1.32.0
  • Operating System: windows
  • Python Version: 3.8

maryamag85 avatar Aug 18 '21 19:08 maryamag85

Hi, experiencing problem with AzureBlobStorage as well, Only I don't get any errors - the script just doesn't run. Any advice?

emhacker avatar Mar 28 '22 11:03 emhacker