-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
Unhandled "Exception initializing step size." #308
Comments
Interesting! Thanks for the report. Does this work in CmdStan? Looks like each chain fails on "Exception initializing step size." Assuming this is what has happened, pystan needs to give useful information to the user. The current behavior is wrong. |
Or was this intended to be run under |
Yeah! Looks like fixed_param was the right way to go... just wasn't clear what was wrong from the message. Maybe that would be a good docs entry: "if you're trying to do PPC, use fixed_param" ... I guess I'm still not clear on what the difference is between sample and fixed_param... also a good docs entry: "here's the difference between functions you can call on a model object". Thanks! I guess this could probably be closed. |
Glad This is still certainly a bug. I changed the title to better indicate what needs to be done. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Describe the bug
Describe your system
Steps/Code to Reproduce
Sampling...
Messages received during sampling:
Gradient evaluation took 1e-06 seconds
1000 transitions using 10 leapfrog steps per transition would take 0.01 seconds.
Adjust your expectations accordingly!
Exception initializing step size.
Posterior is improper. Please check your model.
Gradient evaluation took 0 seconds
1000 transitions using 10 leapfrog steps per transition would take 0 seconds.
Adjust your expectations accordingly!
Exception initializing step size.
Posterior is improper. Please check your model.
Gradient evaluation took 1e-06 seconds
1000 transitions using 10 leapfrog steps per transition would take 0.01 seconds.
Adjust your expectations accordingly!
Exception initializing step size.
Posterior is improper. Please check your model.
Gradient evaluation took 1e-06 seconds
1000 transitions using 10 leapfrog steps per transition would take 0.01 seconds.
Adjust your expectations accordingly!
Exception initializing step size.
Posterior is improper. Please check your model.
0 [>---------------------------] 1 sec
Done.
AssertionError Traceback (most recent call last)
in
----> 1 prior_fit_51 = prior51.sample(num_chains=4, num_samples=1000)
2
3 prior_df_51 = prior_fit_51.to_frame()
~/.local/lib/python3.8/site-packages/stan/model.py in sample(self, **kwargs)
66
67 """
---> 68 return self.hmc_nuts_diag_e_adapt(**kwargs)
69
70 def hmc_nuts_diag_e_adapt(self, **kwargs) -> stan.fit.Fit:
~/.local/lib/python3.8/site-packages/stan/model.py in hmc_nuts_diag_e_adapt(self, **kwargs)
86 """
87 kwargs["function"] = "stan::services::sample::hmc_nuts_diag_e_adapt"
---> 88 return self._create_fit(kwargs)
89
90 def fixed_param(self, **kwargs) -> stan.fit.Fit:
~/.local/lib/python3.8/site-packages/stan/model.py in _create_fit(self, payload)
270
271 try:
--> 272 return asyncio.run(go())
273 except KeyboardInterrupt:
274 return # type: ignore
/usr/lib/python3.8/asyncio/runners.py in run(main, debug)
41 events.set_event_loop(loop)
42 loop.set_debug(debug)
---> 43 return loop.run_until_complete(main)
44 finally:
45 try:
/usr/lib/python3.8/asyncio/base_events.py in run_until_complete(self, future)
614 raise RuntimeError('Event loop stopped before Future completed.')
615
--> 616 return future.result()
617
618 def stop(self):
~/.local/lib/python3.8/site-packages/stan/model.py in go()
252 io.error_line("\nDone.")
253
--> 254 fit = stan.fit.Fit(
255 stan_outputs,
256 num_chains,
~/.local/lib/python3.8/site-packages/stan/fit.py in init(self, stan_outputs, num_chains, param_names, constrained_param_names, dims, num_warmup, num_samples, num_thin, save_warmup)
93 self._draws[:, draw_index, chain_index] = draw_row
94 draw_index += 1
---> 95 assert draw_index == num_samples_saved
96 assert self.sample_and_sampler_param_names and self._draws.size
97 self._draws.flags["WRITEABLE"] = False
AssertionError:
The text was updated successfully, but these errors were encountered: