Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialization failed #512

Closed
dat19-8 opened this issue Aug 16, 2021 · 5 comments
Closed

Initialization failed #512

dat19-8 opened this issue Aug 16, 2021 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@dat19-8
Copy link

dat19-8 commented Aug 16, 2021

Describe the bug
When fitting the ETSFull and ETSMap models on an hourly time frame, I'm receiving the following error: Initialization failed.
You can find the full error description below in the Additional context

Expected behavior
I want to forecasting the demand according to an hourly data frame ( or 30 mins time frame). This is not even starting by fitting.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS: macOS
  • Python Version: Python 3.6. 9
  • Versions of Major Dependencies : pandas==1.1.5, scikit-learn==0.24.2, 'matplotlib==3.3.4'

Additional context

RemoteTraceback Traceback (most recent call last)
RemoteTraceback:
"""
Traceback (most recent call last):
File "/usr/lib/python3.7/multiprocessing/pool.py", line 121, in worker
result = (True, func(*args, **kwds))
File "/usr/lib/python3.7/multiprocessing/pool.py", line 44, in mapstar
return list(map(*args))
File "stanfit4anon_model_982090c5656030fa038b63e5c383dbff_326254919482697396.pyx", line 373, in stanfit4anon_model_982090c5656030fa038b63e5c383dbff_326254919482697396._call_sampler_star
File "stanfit4anon_model_982090c5656030fa038b63e5c383dbff_326254919482697396.pyx", line 406, in stanfit4anon_model_982090c5656030fa038b63e5c383dbff_326254919482697396._call_sampler
RuntimeError: Initialization failed.
"""

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

RuntimeError Traceback (most recent call last)
in ()
----> 1 dlt.fit(train_df)

7 frames
/usr/lib/python3.7/multiprocessing/pool.py in mapstar()
42
43 def mapstar(args):
---> 44 return list(map(*args))
45
46 def starmapstar(args):

stanfit4anon_model_982090c5656030fa038b63e5c383dbff_326254919482697396.pyx in stanfit4anon_model_982090c5656030fa038b63e5c383dbff_326254919482697396._call_sampler_star()

stanfit4anon_model_982090c5656030fa038b63e5c383dbff_326254919482697396.pyx in stanfit4anon_model_982090c5656030fa038b63e5c383dbff_326254919482697396._call_sampler()

RuntimeError: Initialization failed.

@dat19-8 dat19-8 added the bug Something isn't working label Aug 16, 2021
@edwinnglabs
Copy link
Collaborator

@dat19-8 could you also provide the version of orbit-ml you are using?
couple of checks suggesting here:

  1. could you also check under orbit/stan_compiled/ do you have the ets.pkl file? if so, maybe try remove it and recompile one more time
  2. reinstall orbit-ml with latest version
  3. check any nulls, invalid values in your data frame

@dat19-8
Copy link
Author

dat19-8 commented Aug 19, 2021

This is the version I'm using: Version: 1.0.15
I tried all the suggestions and it didn't work, I'm still receiving the same error for the hourly timeframe forecasting.

@wangzhishi
Copy link
Contributor

can you share a reproducible notebook with the errors (along with the data)?

@dat19-8
Copy link
Author

dat19-8 commented Aug 20, 2021

Just a new update, the LGT model did fit after checking if there are some missing hours/days.
But, I received a new error which is MemoryError: Unable to allocate 1.43 GiB for an array with shape (10000, 19191) and data type float64. Knowing that, the shape of the dataset is: 19859 rows × 6 columns, df_train shape as follows: 19139 rows × 6 columns, and df_test shape: 720 rows × 6 columns. The error is showing that we have 10k rows and 19k columns when running the following code predicted_df = lgt.predict(df=test_df)

Additional context

MemoryError Traceback (most recent call last)
in
----> 1 predicted_df = lgt.predict(df=test_df)

/opt/conda/lib/python3.7/site-packages/orbit/models/template.py in predict(self, df, decompose, **kwargs)
400 posterior_samples[k] = np.repeat(v, self.n_bootstrap_draws, axis=0)
401 predicted_dict = self._predict(
--> 402 posterior_estimates=posterior_samples, df=df, include_error=True, **kwargs
403 )
404 percentiles_dict = compute_percentiles(predicted_dict, self._prediction_percentiles)

/opt/conda/lib/python3.7/site-packages/orbit/models/lgt.py in _predict(self, posterior_estimates, df, include_error, **kwargs)
305 # Model Attributes
306 ################################################################
--> 307 model = deepcopy(posterior_estimates)
308 for k, v in model.items():
309 model[k] = torch.from_numpy(v)

/opt/conda/lib/python3.7/copy.py in deepcopy(x, memo, _nil)
148 copier = _deepcopy_dispatch.get(cls)
149 if copier:
--> 150 y = copier(x, memo)
151 else:
152 try:

/opt/conda/lib/python3.7/copy.py in _deepcopy_dict(x, memo, deepcopy)
239 memo[id(x)] = y
240 for key, value in x.items():
--> 241 y[deepcopy(key, memo)] = deepcopy(value, memo)
242 return y
243 d[dict] = _deepcopy_dict

/opt/conda/lib/python3.7/copy.py in deepcopy(x, memo, _nil)
159 copier = getattr(x, "deepcopy", None)
160 if copier:
--> 161 y = copier(memo)
162 else:
163 reductor = dispatch_table.get(cls)

MemoryError: Unable to allocate 1.43 GiB for an array with shape (10000, 19191) and data type float64

@wangzhishi
Copy link
Contributor

I think this is related to your machine specifics (maybe not enough RAM).

@dat19-8 dat19-8 closed this as completed Aug 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants