Issue with 'HoltWintersResultsWrapper' while loading Azure AutoMl model in AzureML

362 Views Asked by At

I am sure this is something basic but I have been banging my head against the wall for a while now and I can't figure it out.

I have trained and registered a model using automl in AzureML. The model is visible in the registry.

When I try to load it in order to do something with it, I use this basic/standard code:

from azureml.core.model import Model
import joblib
from azureml.core import Workspace
from azureml.core.environment import Environment

ws = Workspace.from_config()

model_obj = Model(ws, "ModelName")
model_path = model_obj.download(exist_ok = True)
model = joblib.load(model_path)

And I get this lovely error

ImportError: cannot import name 'HoltWintersResultsWrapper' from 'statsmodels.tsa.holtwinters' (/anaconda/envs/azureml_py38/lib/python3.8/site-packages/statsmodels/tsa/holtwinters/__init__.py)

My statsmodels and automl packages are updated.

I have even tried removing exponential models from the automl configuration to see if it was a specific issue with these models.

I have also tried changing the environment to a curated one but nothing seems to work.

I didn't get anywhere online as well so here I am.

Does anyone know what the heck is going on here?

Thanks!

2

There are 2 best solutions below

0
On BEST ANSWER

I had this same issue, and wasn't able to find a good answer, until i tried to upgrade some packages of the azureml-sdk.

Listed below are the packages that I upgraded

!pip install --upgrade azureml-sdk
!pip install --upgrade azureml-automl-core
!pip install --upgrade azureml-train-automl
!pip install --upgrade azureml-train-automl-client
!pip install --upgrade azureml-train-automl-runtime
!pip install --upgrade azureml-train-core

i've upgraded those to version 1.52.0 i'm not sure which is the one that solves the issue. But after you do this, re-start your kernel and try running this script.

from statsmodels.tsa.holtwinters import ExponentialSmoothing, HoltWintersResultsWrapper

if you can call the HoltWintersResultsWrapper, then most likely you solve the issue.

Hope this helps anyone else who ran into this same problem.

Cheers !

0
On

The issue is with the way we are calling the module. Some of the modules are dependent ion calling, they must be called with their parent package name. In the function calling the HoltWintersResultsWrapper, replace the existing calling method with the function.

Check with the document procedure designed by programtalk

**

assert isinstance(
        statsmodels_loaded,
        statsmodels.tsa.holtwinters.results.HoltWintersResultsWrapper,
    )

**