Azure / Azure/MachineLearningNotebooks

AzureMLException with model.download

Aperta
#1,545 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
ADO bug Data4ML
Lingua principale
Jupyter Notebook
Stelle
4.4k
Fork
2.6k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Hi!

When trying to download a registered model from the AMLS workspace, I'm getting the following traceback. The file shows up in the `target_dir` (and ADLS path) however the size is 0 bytes, so it is making the file, however no data is being transferred into it.

```python
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
/databricks/python/lib/python3.7/site-packages/azureml/_file_utils/file_utils.py in _retry(exec_func, clean_up_func, max_retries, exceptions)
432 try:
--> 433 return exec_func()
434 except exceptions as request_exception:

/databricks/python/lib/python3.7/site-packages/azureml/_file_utils/file_utils.py in exec_func()
212 max_connections=max_concurrency,
--> 213 validate_content=_validate_check_sum)
214 file_size = os.stat(path).st_size

/databricks/python/lib/python3.7/site-packages/azureml/_vendor/azure_storage/blob/baseblobservice.py in get_blob_to_path(self, container_name, blob_name, file_path, open_mode, snapshot, start_range, end_range, validate_content, progress_callback, max_connections, lease_id, if_modified_since, if_unmodified_since, if_match, if_none_match, timeout)
1855
-> 1856 with open(file_path, open_mode) as stream:
1857 blob = self.get_blob_to_stream(

FileNotFoundError: [Errno 2] No such file or directory: '/dbfs/mnt/prism0stg0dls/amls/enablers/amls_model_saving/models/test2/test2/variables/variables.data-00000-of-00001'

During handling of the above exception, another exception occurred:

AzureMLException Traceback (most recent call last)
in
----> 1 existing_model.download(target_dir="/dbfs/mnt/prism0stg0dls/amls/enablers/amls_model_saving/models/test2")

/databricks/python/lib/python3.7/site-packages/azureml/core/model.py in download(self, target_dir, exist_ok, exists_ok)
999
1000 # download files using sas
-> 1001 file_paths = self._download_model_files(sas_to_relative_download_path, target_dir, exist_ok)
1002 if len(file_paths) == 0:
1003 raise WebserviceException("Illegal state. Unpack={}, Paths in target_dir is "

/databricks/python/lib/python3.7/site-packages/azureml/core/model.py in _download_model_files(self, sas_to_relative_download_path, target_dir, exist_ok)
940 "{}".format(target_path), logger=module_logger)
941 sas_to_relative_download_path[sas] = target_path
--> 942 download_file(sas, target_path, stream=True)
943
944 if self.unpack:

/databricks/python/lib/python3.7/site-packages/azureml/_file_utils/file_utils.py in download_file(source_uri, path, max_retries, stream, protocol, session, _validate_check_sum, max_concurrency)
219 'present in blob.'.format(file_size, content_length))
220
--> 221 return _retry(exec_func, max_retries=max_retries)
222
223 # download using requests.Session

/databricks/python/lib/python3.7/site-packages/azureml/_file_utils/file_utils.py in _retry(exec_func, clean_up_func, max_retries, exceptions)
443 else:
444 module_logger.error('Failed to download file with error: {}'.format(request_exception))
--> 445 raise AzureMLException('Download of file failed with error: {}'.format(request_exception))
446 finally:
447 clean_up_func()

AzureMLException: AzureMLException:
Message: Download of file failed with error: [Errno 2] No such file or directory: '/dbfs/mnt/prism0stg0dls/amls/enablers/amls_model_saving/models/test2/test2/variables/variables.data-00000-of-00001'
InnerException None
ErrorResponse
{
"error": {
"message": "Download of file failed with error: [Errno 2] No such file or directory: '/dbfs/mnt/prism0stg0dls/amls/enablers/amls_model_saving/models/test2/test2/variables/variables.data-00000-of-00001'"
}
}

```

![image](https://user-images.githubusercontent.com/7530947/125011096-a8c32700-e01c-11eb-83b4-4305be4095df.png)

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Inizia riproducendo la chiamata esistente a existing_model.download che fallisce con il target_dir mostrato, quindi traccia il flusso attraverso azureml/core/model.py e azureml/_file_utils/file_utils.py, prestando particolare attenzione al percorso di destinazione nel traceback. Il lavoro è completato quando il modello registrato viene scaricato senza AzureMLException e il file variables.data-00000-of-00001 risultante contiene i dati previsti invece di essere di zero byte.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
azure, python
Ambito
cloud, machine-learning
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
30/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.