Skip to content
This repository has been archived by the owner on Jun 7, 2023. It is now read-only.

AttributeError: 'StanModel' object has no attribute 'fit_class' #153

Closed
vlam1 opened this issue Jul 16, 2021 · 4 comments · Fixed by #154
Closed

AttributeError: 'StanModel' object has no attribute 'fit_class' #153

vlam1 opened this issue Jul 16, 2021 · 4 comments · Fixed by #154
Assignees

Comments

@vlam1
Copy link

vlam1 commented Jul 16, 2021

Hi,

I encountered this error after our PAD container was restarted, and wondering if I can get some help resolving it. This seems like a dependency issue that was introduced recently in the quay.io/aicoe/prometheus-anomaly-detector:latest image. There are other PAD containers that are up and running fine for 9 days now with the same configs, only the restarted containers are going into crashloopbackoff (I'm guessing it's because the actual latest image was pulled on the restart).

Error traceback:

multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
  File "/opt/conda/envs/PAD/lib/python3.8/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/opt/conda/envs/PAD/lib/python3.8/multiprocessing/pool.py", line 48, in mapstar
    return list(map(*args))
  File "app.py", line 146, in train_individual_model
    predictor_model.train(
  File "/model.py", line 45, in train
    self.model.fit(self.metric.metric_values)
  File "/opt/conda/envs/PAD/lib/python3.8/site-packages/prophet/forecaster.py", line 1171, in fit
    self.params = self.stan_backend.fit(stan_init, dat, **kwargs)
  File "/opt/conda/envs/PAD/lib/python3.8/site-packages/prophet/models.py", line 264, in fit
    self.stan_fit = self.model.optimizing(**args)
  File "/opt/conda/envs/PAD/lib/python3.8/site-packages/pystan/model.py", line 542, in optimizing
    fit = self.fit_class(data, seed)
AttributeError: 'StanModel' object has no attribute 'fit_class'
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "app.py", line 174, in <module>
    train_model(initial_run=True, data_queue=predicted_model_queue)
  File "app.py", line 164, in train_model
    result = p.map(training_partial, PREDICTOR_MODEL_LIST)
  File "/opt/conda/envs/PAD/lib/python3.8/multiprocessing/pool.py", line 364, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
  File "/opt/conda/envs/PAD/lib/python3.8/multiprocessing/pool.py", line 771, in get
    raise self._value
AttributeError: 'StanModel' object has no attribute 'fit_class'

I appreciate the help.

@4n4nd
Copy link
Contributor

4n4nd commented Jul 16, 2021

@vlam1 could you please try using quay.io/aicoe/prometheus-anomaly-detector:ubi in one of your containers to see if it works?
I was able to test it, just want one more person to try before I update it in the repo.

@vlam1
Copy link
Author

vlam1 commented Jul 16, 2021

@4n4nd yup, I just confirmed the update fixed the issue.

@4n4nd
Copy link
Contributor

4n4nd commented Jul 16, 2021

Awesome. Thanks!

@vlam1
Copy link
Author

vlam1 commented Jul 16, 2021

Thank you @4n4nd! 😃

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants