Azure / Azure/MachineLearningNotebooks

I use run.upload_file to upload a file to file share datastore but failed

Offen
#1,546 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
ADO bug MLOps
Vorherrschende Sprache
Jupyter Notebook
Sterne
4.4k
Forks
2.6k
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

I use Designer Execute Python Script module to upload a image file to file share datastore, but failed. From the error message, it is not the module error, but this function does not support uploading files to file share datastore.

Following is the error message:
AmlExceptionMessage:User program failed with FailedToEvaluateScriptError: The following error occurred during script evaluation, please view the output log for more information:
---------- Start of error message from Python interpreter ----------
Got exception when invoking script at line 33 in function azureml_main: 'ServiceException: (UserError) Currently only AzureBlob artifacts are supported'.
---------- End of error message from Python interpreter ----------

ModuleExceptionMessage:FailedToEvaluateScript: The following error occurred during script evaluation, please view the output log for more information:
---------- Start of error message from Python interpreter ----------
Got exception when invoking script at line 33 in function azureml_main: 'ServiceException: (UserError) Currently only AzureBlob artifacts are supported'.
---------- End of error message from Python interpreter ----------
![image](https://user-images.githubusercontent.com/39058063/125037192-67875180-e0c6-11eb-8ae8-231e8fb5ad20.png)

```
Following is my script for Execute Python Script module:

# The script MUST contain a function named azureml_main
# which is the entry point for this module.

# imports up here can be used to
import pandas as pd

# The entry point function MUST have two input arguments.
# If the input port is not connected, the corresponding
# dataframe argument will be None.
# Param: a pandas.DataFrame
# Param: a pandas.DataFrame
def azureml_main(dataframe1 = None, dataframe2 = None):

# Execution logic goes here
print(f'Input pandas.DataFrame #1: {dataframe1}')

from matplotlib import pyplot as plt

plt.plot([1, 2, 3, 4])

plt.ylabel('some numbers')

img_file = "line.png"

plt.savefig(img_file)

from azureml.core import Run

run = Run.get_context(allow_offline=True)

run.upload_file(f"graphics/{img_file}", img_file, datastore_name="workspacefilestore")

# If a zip file is connected to the third input port,
# it is unzipped under "./Script Bundle". This directory is added
# to sys.path. Therefore, if your zip file contains a Python file
# mymodule.py you can import it using:
# import mymodule

# Return value must be of a sequence of pandas.DataFrame
# E.g.
# - Single return value: return dataframe1,
# - Two return values: return dataframe1, dataframe2
return dataframe1,
```

---
#### Document Details

⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*

* ID: 9a70336d-fb4a-4c18-26d0-68784b5b3d72
* Version Independent ID: e28876d8-08a0-8546-4bd1-6e434c8c7826
* Content: [azureml.core.Run class - Azure Machine Learning Python](https://docs.microsoft.com/en-us/python/api/azureml-core/azureml.core.run(class)?view=azure-ml-py)
* Content Source: [AzureML-Docset/stable/docs-ref-autogen/azureml-core/azureml.core.Run(class).yml](https://github.com/MicrosoftDocs/MachineLearning-Python-pr/blob/live/AzureML-Docset/stable/docs-ref-autogen/azureml-core/azureml.core.Run(class).yml)
* Service: **machine-learning**
* Sub-service: **core**
* GitHub Login: @DebFro
* Microsoft Alias: **debfro**

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Beginnen Sie mit dem dokumentierten azureml.core.Run.upload_file-Einstiegspunkt und reproduzieren Sie das Beispiel Execute Python Script unter Verwendung des workspacefilestore-Datenspeichers. Bestätigen Sie den aktuellen AzureBlob-only-Fehler und prüfen Sie anschließend das relevante Verhalten des Azure Machine Learning SDK; als erledigt gilt die Aufgabe, wenn Uploads in einen Dateifreigabe-Datenspeicher erfolgreich sind und das vorhandene Beispiel oder Tests diesen Pfad abdecken.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
azure, machine-learning, python
Bereich
cloud, machine-learning
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.