get_model_path() failed for me, not copying the model to cache. The error messaged advised me to set the logging level to DEBUG to investigate more, but it would be good if we can clarify how we can do this in the documentation. (Maybe some other useful link?)
For example:
>>> Model.get_model_path('a')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/miniconda/lib/python3.6/site-packages/azureml/core/model.py", line 328, in get_model_path
return Model._get_model_path_local(model_name, version)
File "/opt/miniconda/lib/python3.6/site-packages/azureml/core/model.py", line 350, in _get_model_path_local
return Model._get_model_path_local_from_root(model_name)
File "/opt/miniconda/lib/python3.6/site-packages/azureml/core/model.py", line 394, in _get_model_path_local_from_root
"set logging level to DEBUG.".format(candidate_model_path))
azureml.exceptions._azureml_exception.ModelNotFoundException: Model not found in cache or in root at ./a. For more info,set logging level to DEBUG.
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@dem108 Thanks for the feedback. We are actively investigating the issue and will update you shortly.
@dem108 Have you tried running the python code mentioned in the troubleshooting doc in the container shell ?
@hning86 Can you please take a look at this ?
Yes, I did try the troubleshooting doc and eventually solved my specific get_model_path problem, but it would be still good if we can add more details on how to set the logging level as advised in the error message. The current documentation just describes the potential problem, but not suggesting what to do in such case.
@dem108 Good to know that your problem was solved and thanks for the feedback. I have assigned the issue to the content owner to take a look and update the doc as appropriate.
I am having exactly same problem with Model.get_model_path() failing for batch prediction use case. Is there an easy way to set the logging level to DEBUG as documentation suggests ?
The stack trace is similar to @dem108's:
Traceback (most recent call last):
File "azureml-setup/context_manager_injector.py", line 152, in <module>
execute_with_context(cm_objects, options.invocation)
File "azureml-setup/context_manager_injector.py", line 88, in execute_with_context
runpy.run_path(sys.argv[0], globals(), run_name="__main__")
File "/azureml-envs/azureml_114e13c8bcd357be24a742f9755fd21f/lib/python3.6/runpy.py", line 263, in run_path
pkg_name=pkg_name, script_name=fname)
File "/azureml-envs/azureml_114e13c8bcd357be24a742f9755fd21f/lib/python3.6/runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "/azureml-envs/azureml_114e13c8bcd357be24a742f9755fd21f/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "test.py", line 31, in <module>
model_path = Model.get_model_path(model_name='sample_model', version=1)
File "/azureml-envs/azureml_114e13c8bcd357be24a742f9755fd21f/lib/python3.6/site-packages/azureml/core/model.py", line 322, in get_model_path
return Model._get_model_path_remote(model_name, version, active_workspace)
File "/azureml-envs/azureml_114e13c8bcd357be24a742f9755fd21f/lib/python3.6/site-packages/azureml/core/model.py", line 581, in _get_model_path_remote
model_path = model.download(target_dir, exist_ok=True)
File "/azureml-envs/azureml_114e13c8bcd357be24a742f9755fd21f/lib/python3.6/site-packages/azureml/core/model.py", line 536, in download
sas_to_relative_download_path = self._get_sas_to_relative_download_path_map(asset)
File "/azureml-envs/azureml_114e13c8bcd357be24a742f9755fd21f/lib/python3.6/site-packages/azureml/core/model.py", line 471, in _get_sas_to_relative_download_path_map
raise AzureMLException("No files to download. Did you upload files?")
azureml.exceptions._azureml_exception.AzureMLException: No files to download. Did you upload files?
@Blackmist
@akshaya-a
@tomekwier DEBUG level is set using the standard Python logging. So something like this in a Python script from the container shell:
import logging
logging.basicConfig(level=logging.DEBUG)
from azureml.core.model import Model
print(Model.get_model_path(model_name='my-best-model'))
Thanks for reporting this, I'll update this document today to add the info on enabling DEBUG logging level.
If this solves the issue, then #please-close.
@dem108 do you recall how did you solve your problem ?
Most helpful comment
@tomekwier DEBUG level is set using the standard Python logging. So something like this in a Python script from the container shell:
Thanks for reporting this, I'll update this document today to add the info on enabling DEBUG logging level.