1

I've been trying to make an endpoint using the azure ML designer. The basic idea is to download a trained model from my Azure subscription blob storage and use it to make predictions on new data. The problem I'm facing is that whenever I download the pickle file in the script and try to load it, I always get an error saying that the path or directory doesn't exist. Is there anyway to solve this or is it a limitation of the compute cluster attached to the pipeline?

Here are some screenshots for the code snippet I'm trying to run and the error returned.

enter image description here

enter image description here

  • hiya -- sorry you're having this issue and welcome to stackoverflow. can you please share the text of the error message and your code instead of screenshots? Here's more info on how to do that. https://stackoverflow.com/help/formatting – Anders Swanson Sep 30 '21 at 15:59

2 Answers2

1

My first guess is that the error seems to be saying the Downloads\vectorizer.pkl is a directory. One thing worth considering here is that you're using the backslach, \ in the string which is a Windows path. However, \ can get you into trouble in Python strings as it is often escaped.

I know you're using raw string literals, but humor me and try a posix style file path like below for your line 22?

datastore.download('Downloads//vectorizer.pkl', prefix = f'Model_{origin}/vectorizer.pkl'

See this Stack Overflow question for more information on working with Windows paths in Python.

Anders Swanson
  • 3,637
  • 1
  • 18
  • 43
  • 1
    I just tried that and it doesn't work. My gues is that since it's running in a virtual machine myabe the file is never trylu downloaded and only an instance of the file is created. Meaning I can't really acess it. – Guilherme Takata Sep 30 '21 at 17:40
0

The “score.py” exposed in trained_model_outputs is for customized deployment, only have model init and scoring logic, you can add your own pre-process and post-process code on top of that. The scoring logic that having pre-process logic is available through Designer deployed web service, which can be on both AKS and ACI. You can follow this doc: Tutorial: Deploy ML models with the designer - Azure Machine Learning | Microsoft Docs.

You may not need “model + score.py”, any way that allow you do this with a programmatic approach is good.

if you run on a remote compute target, you register the blob store as a datastore and then use it with a path, and tell the run to either download the data or mount the data. Automatic mounting works on AMLCompute, but currently not on a remote VM.

https://github.com/Azure/MachineLearningNotebooks/tree/master/how-to-use-azureml/work-with-data

Ram
  • 2,459
  • 1
  • 7
  • 14