添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

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!

Hi @odyse, yes. I checked the documentation and they said this can sometimes be caused due to a mismatch of libraries/packages' versions. So I played a bit with the versions of azure-ml libraries and it worked. – E.Brum Aug 12, 2022 at 13:33 I have run into the same issue myself loading an Azure AutoML model into an Azure Synapse spark pool, I'd love to know any more details about how you solved it. – 8forty Jan 23, 2023 at 23:36

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 !

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,
        

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.