You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug
Seems to be an error with spawning processes for sampling – full error below. Annoyingly, sometimes it samples, but most of the time it fails out, which makes me question exactly why it’s happening.
Following the example.
coal = np.loadtxt(pm.get_data("coal.csv"))
years = int(coal.max() - coal.min())
bins = years // 4
hist, x_edges = np.histogram(coal, bins=bins)
# compute the location of the centers of the discretized data
x_centers = x_edges[:-1] + (x_edges[1] - x_edges[0]) / 2
# xdata needs to be 2D for BART
x_data = x_centers[:, None]
# express data as the rate number of disaster per year
y_data = hist
with pm.Model() as model_coal:
μ_ = pmb.BART("μ_", X=x_data, Y=np.log(y_data), m=20)
μ = pm.Deterministic("μ", pm.math.exp(μ_))
y_pred = pm.Poisson("y_pred", mu=μ, observed=y_data)
idata_coal = pm.sample(random_seed=94122)
returns the following error:
EOFError Traceback (most recent call last)
/Users/jp/Dropbox/Projects/pymc_example.py in line 13
61 y_data = hist
62 with pm.Model() as model_coal:
---> 63 μ_ = pmb.BART("μ_", X=x_data, Y=np.log(y_data), m=20)
64 μ = pm.Deterministic("μ", pm.math.exp(μ_))
65 y_pred = pm.Poisson("y_pred", mu=μ, observed=y_data)
File ~/miniconda3/envs/pymc/lib/python3.10/site-packages/pymc_bart/bart.py:139, in BART.__new__(cls, name, X, Y, m, alpha, beta, response, split_prior, split_rules, separate_trees, **kwargs)
134 if response in ["linear", "mix"]:
135 warnings.warn(
136 "Options linear and mix are experimental and still not well tested\n"
137 + "Use with caution."
138 )
--> 139 manager = Manager()
140 cls.all_trees = manager.list()
142 X, Y = preprocess_xy(X, Y)
File ~/miniconda3/envs/pymc/lib/python3.10/multiprocessing/context.py:57, in BaseContext.Manager(self)
55 from .managers import SyncManager
56 m = SyncManager(ctx=self.get_context())
---> 57 m.start()
58 return m
...
--> 383 raise EOFError
384 else:
385 raise OSError("got end of file during message")
Bug
Seems to be an error with spawning processes for sampling – full error below. Annoyingly, sometimes it samples, but most of the time it fails out, which makes me question exactly why it’s happening.
Following the example.
returns the following error:
Session info is here:
The text was updated successfully, but these errors were encountered: