-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Parallel sampling error when sampling trace #3884
Comments
Hi Nitish, Knowing that, this model runs with PyMC3 master branch: with pm.Model() as model:
m = pm.Normal("m", 0., 1.)
b = pm.Normal("b", 0., 1.5)
sigma = pm.Exponential("sigma", 1.)
pm.Normal("obs", mu=m * x + b, sigma=sigma observed=y)
trace = pm.sample(chains=2) Does this work for you too? |
Hi @AlexAndorra, thanks for the reply! I understand now and yes this works for me but why was the original model still working in v3.8? |
Could the occurence of |
I can confirm that the original model runs with 3.8, so it looks like something happened on the dev branch, as Michael pointed out. EDIT: There indeed seems to be a problem: this model from the documentation doesn't run anymore (same error as above), even with more regularizing priors centered on the true values. |
After exploring further, I noticed the following simple model (which comes from this doc NB) only runs when N = 10000
μ_actual = np.array([1, -2])
Σ_actual = np.array([[0.5, -0.3], [-0.3, 1.]])
x = np.random.multivariate_normal(μ_actual, Σ_actual, size=N)
with pm.Model() as m:
packed_L = pm.LKJCholeskyCov('packed_L', n=2, eta=2., sd_dist=pm.Exponential.dist(1.0))
L = pm.expand_packed_triangular(2, packed_L)
Σ = pm.Deterministic('Σ', L.dot(L.T))
μ = pm.Normal('μ', 0., 10., shape=2, testval=x.mean(axis=0))
obs = pm.MvNormal('obs', μ, chol=L, observed=x)
trace = pm.sample(init="adapt_diag")
|
I have seen this many times, as well, to the point where I routinely supply |
Yeah I think that's why. What's puzzling to me though, is that this same model runs smoothly in the publicly released 3.8, without having to change the initialization and supply |
I cannot reproduce your example @AlexAndorra |
@junpenglao, do you mean that for you the model above samples on the master branch without having to specify |
I wonder -- is there some way to take an existing run that has this problem and capture the random seed, so that we can replicate the behavior we are seeeing? It's frustrating to me that I see this problem all the time, but it can't be replicated, and so cannot be fixed. |
If there is, it would be great to add how to do it here or somewhere else and add the link in arviz-devs/arviz#1083 too |
This code fails for me every time I run it. Chain 2 fails after between 600 and 1400 total samples. I guess the number of completed samples from chains 0, 1 & 3 vary each time I run before the chain 2 failure. I updated from PyMC3 master yesterday
|
I'm closing this for now, because, after some discussions, this seems to be a random error (i.e false positive), but let's be attentive and deal with this if problems arise in the coming 3.9 release. |
Why is it label as a random error? and how can we solve it? I am having this error, I tried what is mentioned here but still getting same error. |
@NestorESA if you're using the latest version, please open a new issue with a minimal example. |
Description of your problem
The following code gives an error when using PyMC3 development branch.
Please provide a minimal, self-contained, and reproducible example.
Please provide the full traceback.
Please provide any additional information below.
Note that this code originally worked for @OriolAbril on an older version of PyMC3 and still works for me on PyMC3 3.8 but using the development branch causes this error.
Versions and main components
The text was updated successfully, but these errors were encountered: