'Problem in running PYMC3 - I cannot do sampling and get the trace results

I am a new learner in PYMC3 and I installed the package recently and i tried to run a sample example from the pcmc3 avilbale examples which is this one:

Binomial regression — PyMC3 3.11.5 documentation

I already installed all required packages but when I try to get sample using:

with binomial_regression_model:
trace = pm.sample(1000, tune=2000, return_inferencedata=True)

then i get this error:

You can find the C code in this temporary file: C:\Users\mmabae\AppData\Local\Temp\theano_compilation_error_blwto6qk
…

The above exception was the direct cause of the following exception:

ValueError Traceback (most recent call last)
File ~\Anaconda3\lib\site-packages\pymc3\parallel_sampling.py:135, in run()
132 try:
133 # We do not create this in init, as pickling this
134 # would destroy the shared memory.
→ 135 self._unpickle_step_method()
136 self._point = self._make_numpy_refs()

File ~\Anaconda3\lib\site-packages\pymc3\parallel_sampling.py:118, in _unpickle_step_method()
117 except Exception:
→ 118 raise ValueError(unpickle_error)
119 elif self._pickle_backend == “dill”:

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)
Input In [41], in <cell line: 1>()
1 with binomial_regression_model:
----> 2 trace = pm.sample(1000, tune=2000, return_inferencedata=True)

What is the problem? is there anything wrong with my package installation? I tried it from Pycharm and Jupyter but all is the same error. when i check installed package it seems that all is installed but I do not know why it did not work



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source