none
Error 0085 while executing script in Azureml (Error only occurs on Excel or API, not in Experiment)

    Question

  • Hello,

    I got a issue, my experiment has two models.

    It works perfect on Experimentation, but when I deploy to web service I receive this error.



    • Error! {"error":{"code":"ModuleExecutionError","message":"Module execution encountered an error.","details":[{"code":"85","target":"Execute Python Script RRS","message":"Error 0085: The following error occurred during script evaluation, please view the output log for more information:\r\n---------- Start of error message from Python interpreter ----------\r\nCaught exception while executing function: Traceback (most recent call last):\n File \"\\server\\InvokePy.py\", line 120, in executeScript\n outframe = mod.azureml_main(*inframes)\n File \"\\temp\\8886879295127076603.py\", line 40, in azureml_main\n model = joblib.load(\"Script Bundle/modelquarter.sav\")\n File \"C:\\pyhome\\lib\\site-packages\\sklearn\\externals\\joblib\\numpy_pickle.py\", line 443, in load\n with open(filename, 'rb') as file_handle:\nFileNotFoundError: [Errno 2] No such file or directory: 'Script Bundle/modelquarter.sav'\n\r\n\r\n---------- End of error message from Python interpreter ----------"}]}}

    Both models are being reads as : 

    1. sys.path.insert(0,".\Script Bundle")
      model = joblib.load("Script Bundle/model_quarter.sav")

    Please, any advice.

    ps: I can deploy and run without erros with only the first model.

    Thursday, January 3, 2019 2:18 PM

All replies

  • Hi,

    Is the folder Script Bundle within the same folder as your python code?

    You are using a relative path, which means that the program looks for the file in the working directory. The error is telling you that there is no file of that name in the working directory.

    Try using the exact, or absolute, path.

    To give you an idea of what that means, add this to your code:

    import os

    cwd = os.getcwd()  # Get the current working directory (cwd)
    files = os.listdir(cwd)  # Get all the files in that directory
    print("Files in '%s': %s" % (cwd, files))



    MSDN

    Friday, January 4, 2019 9:30 AM
    Moderator
  • Hey, thanks for the answer.

    I checked the full path, on experiment this works well and  the external model can be found on "Script Bundle".

    But, after the deploy to web service, I just found only the other model, this was loaded twice.

    I cant import two Script Bundles?

    Thanks in advance.

    Friday, January 4, 2019 5:01 PM
  • Hi,

    There's a similar issue reported here which might be helpful in your case as well :

    https://stackoverflow.com/questions/37807158/train-multiple-models-with-various-measures-and-accumulate-predictions

    Let us know if this helps. Else, we can probe in further.


    MSDN

    Wednesday, January 9, 2019 9:24 AM
    Moderator