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

the kernel appears to have died. it will restart automatically #4192

Closed
cmencar opened this issue Oct 27, 2020 · 1 comment
Closed

the kernel appears to have died. it will restart automatically #4192

cmencar opened this issue Oct 27, 2020 · 1 comment

Comments

@cmencar
Copy link

cmencar commented Oct 27, 2020

#3285 Description of your problem

I am running the following code within Jupyter Notebook (the code is adapted from ch. 2 of "Bayesian Methods for Hackers
by Cameron Davidson-Pilon", see notebook, cells 24--26.

import pymc3 as pm
import scipy.stats as stats
#figsize(12, 4)

#these two quantities are unknown to us.
true_p_A = 0.05
true_p_B = 0.04

#notice the unequal sample sizes -- no problem in Bayesian analysis.
N_A = 15000
N_B = 750

#generate some observations
observations_A = stats.bernoulli.rvs(true_p_A, size=N_A)
observations_B = stats.bernoulli.rvs(true_p_B, size=N_B)

with pm.Model() as model:
    p_A = pm.Uniform("p_A", 0, 1)
    p_B = pm.Uniform("p_B", 0, 1)
    
    # Define the deterministic delta function. This is our unknown of interest.
    delta = pm.Deterministic("delta", p_A - p_B)

    
    # Set of observations, in this case we have two observation datasets.
    obs_A = pm.Bernoulli("obs_A", p_A, observed=observations_A)
    obs_B = pm.Bernoulli("obs_B", p_B, observed=observations_B)

    # To be explained later.
    step = pm.Metropolis()
    trace = pm.sample(20000, step=step)
    burned_trace=trace[1000:]

I run the above code, then re-run it by changing

true_p_B = 0.54

At the second run, the execution will stop at the end of sampling with a pop-up message "the kernel appears to have died. it will restart automatically" (no other messages displayed). Since then, I am unable to use pymc3 unless I reboot the machine.
Same problems by porting the code into Spyder.

edit Unfortunately I am unable to always reproduce the error. It seems to have a randomic behavior.

Please provide any additional information below.

Versions and main components

  • PyMC3 Version: 3.9.2
  • Theano Version: 1.0.4
  • Python Version: 3.7.7
  • Operating system: Linux Mint 20
  • How did you install PyMC3: (conda/pip) conda
@fonnesbeck
Copy link
Member

Since this is not reproducible, I'm going to close the issue. Please feel free to reopen if the problem continues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants