RuntimeError: Error during optimization! using Quickstart sample code

Open
#2,655 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
docker, pandas, python

Research direction

Reproduce the Quickstart code with the listed Python, pandas, Prophet, and devcontainer versions. Start with prophet/models.py and the Dockerfile, then inspect the CmdStanPy optimization output and signal 11 failure. Done means identifying a reproducible cause and documenting or validating a fix for the sample fit.

Written by the indexing model from the issue text.

Description

When I try to execute the Quickstart sample code I get the following error:

Stan Path: /workspaces/prophet/.venv/lib/python3.11/site-packages/prophet/stan_model/cmdstan-2.33.1
15:21:12 - cmdstanpy - INFO - Chain [1] start processing
15:21:12 - cmdstanpy - INFO - Chain [1] done processing
15:21:12 - cmdstanpy - ERROR - Chain [1] error: terminated by signal 11 Unknown error -11
Optimization terminated abnormally. Falling back to Newton.
15:21:12 - cmdstanpy - INFO - Chain [1] start processing
15:21:12 - cmdstanpy - INFO - Chain [1] done processing
15:21:12 - cmdstanpy - ERROR - Chain [1] error: terminated by signal 11 Unknown error -11
Traceback (most recent call last):
  File "/workspaces/prophet/.venv/lib/python3.11/site-packages/prophet/models.py", line 121, in fit
    self.stan_fit = self.model.optimize(**args)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspaces/prophet/.venv/lib/python3.11/site-packages/cmdstanpy/model.py", line 659, in optimize
    raise RuntimeError(msg)
RuntimeError: Error during optimization! Command '/workspaces/prophet/.venv/lib/python3.11/site-packages/prophet/stan_model/prophet_model.bin random seed=70637 data file=/tmp/tmp5e6qrx3k/tsthnvvx.json init=/tmp/tmp5e6qrx3k/p6pq0vgn.json output file=/tmp/tmp5e6qrx3k/prophet_modelfgk7tw4y/prophet_model-20250121152112.csv method=optimize algorithm=lbfgs iter=10000' failed: 

My code is the following:

import pandas as pd
from prophet import Prophet

df = pd.read_csv('https://raw.githubusercontent.com/facebook/prophet/main/examples/example_wp_log_peyton_manning.csv')
m = Prophet()

m.fit(df)

I'm using the following requirements:

prophet==1.1.6
pandas==2.1.4

And this is the devcontainer Dockerfile:

ARG VARIANT="3.11-bullseye"
FROM --platform=linux/amd64 mcr.microsoft.com/devcontainers/python:0-${VARIANT}

RUN apt-get update && apt-get install -y \
    build-essential \
    && rm -rf /var/lib/apt/lists/*

USER vscode

Any ideas?

Dominant language
Python
Stars
20.5k
Forks
4.6k
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from facebook/prophet

All issues in facebook/prophet

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.