Hi – thank you very much for these links. They are exactly what I needed.
However, when I try to run their code (the version Running on PyMC v3.11.4 as myself), I get the error below.
Do you have any idea of what may be going wrong here? Thank you in advance!
RemoteTraceback Traceback (most recent call last)
RemoteTraceback:
“”"
Traceback (most recent call last):
File “/Users/claudia/anaconda3/anaconda3/envs/stsci/lib/python3.7/site-packages/pymc3/parallel_sampling.py”, line 116, in _unpickle_step_method
self._step_method = pickle.loads(self._step_method)
AttributeError: Can’t get attribute ‘LogLike’ on <module ‘main’ (built-in)>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “/Users/claudia/anaconda3/anaconda3/envs/stsci/lib/python3.7/site-packages/pymc3/parallel_sampling.py”, line 135, in run
self._unpickle_step_method()
File “/Users/claudia/anaconda3/anaconda3/envs/stsci/lib/python3.7/site-packages/pymc3/parallel_sampling.py”, line 118, in _unpickle_step_method
raise ValueError(unpickle_error)
ValueError: The model could not be unpickled. This is required for sampling with more than one core and multiprocessing context spawn or forkserver.
“”"
The above exception was the direct cause of the following exception:
ValueError Traceback (most recent call last)
ValueError: The model could not be unpickled. This is required for sampling with more than one core and multiprocessing context spawn or forkserver.
The above exception was the direct cause of the following exception:
RuntimeError Traceback (most recent call last)
/var/folders/mt/j5_ht1ns57zcwpnlm45sqzwr0000gn/T/ipykernel_5791/3401078307.py in
29
30 # Use custom number of draws to replace the HMC based defaults
—> 31 idata_mh = pm.sample(3000, tune=1000, return_inferencedata=True)
32
33 # plot the traces
~/anaconda3/anaconda3/envs/stsci/lib/python3.7/site-packages/pymc3/sampling.py in sample(draws, step, init, n_init, start, trace, chain_idx, chains, cores, tune, progressbar, model, random_seed, discard_tuned_samples, compute_convergence_checks, callback, jitter_max_retries, return_inferencedata, idata_kwargs, mp_ctx, pickle_backend, **kwargs)
557 _print_step_hierarchy(step)
558 try:
→ 559 trace = _mp_sample(**sample_args, **parallel_args)
560 except pickle.PickleError:
561 _log.warning(“Could not pickle model, sampling singlethreaded.”)
~/anaconda3/anaconda3/envs/stsci/lib/python3.7/site-packages/pymc3/sampling.py in _mp_sample(draws, tune, step, chains, cores, chain, random_seed, start, progressbar, trace, model, callback, discard_tuned_samples, mp_ctx, pickle_backend, **kwargs)
1475 try:
1476 with sampler:
→ 1477 for draw in sampler:
1478 trace = traces[draw.chain - chain]
1479 if trace.supports_sampler_stats and draw.stats is not None:
~/anaconda3/anaconda3/envs/stsci/lib/python3.7/site-packages/pymc3/parallel_sampling.py in iter(self)
477
478 while self._active:
→ 479 draw = ProcessAdapter.recv_draw(self._active)
480 proc, is_last, draw, tuning, stats, warns = draw
481 self._total_draws += 1
~/anaconda3/anaconda3/envs/stsci/lib/python3.7/site-packages/pymc3/parallel_sampling.py in recv_draw(processes, timeout)
357 else:
358 error = RuntimeError(“Chain %s failed.” % proc.chain)
→ 359 raise error from old_error
360 elif msg[0] == “writing_done”:
361 proc._readable = True
RuntimeError: Chain 0 failed.