TypeError: cannot pickle 'fortran' object

Hi,

Facing issue while running pm.sample
“Multiprocess sampling (2 chains in 2 jobs)
NUTS: [gamma, alpha, beta_comp, beta, decay, peak, noise_var, tau]
Traceback (most recent call last):
File “C:\Users\deepakkapoor\Desktop\mmx_streamlit\app.py”, line 60, in
media_model = MediaModelBis(ctrl_model, [‘online_sales’])
File “C:\Users\deepakkapoor\Desktop\mmx_streamlit\media_model\media.py”, line 23, in init
self.fit_result, self.fit_summary, self.trace, self.loo, self.waic = fit_model(self.mmm_model, return_all = True)
File “C:\Users\deepakkapoor\Desktop\mmx_streamlit\media_model\sampling.py”, line 12, in fit_model
trace = pm.sample(int(n_samples/chains), tune=int(n_tune_samples/chains), chains=chains,
File “C:\Users\deepakkapoor\anaconda\envs\pymc3_env5\lib\site-packages\deprecat\classic.py”, line 215, in wrapper_function
return wrapped_(*args_, **kwargs_)
File “C:\Users\deepakkapoor\anaconda\envs\pymc3_env5\lib\site-packages\pymc3\sampling.py”, line 575, in sample
trace = _mp_sample(**sample_args, **parallel_args)
File “C:\Users\deepakkapoor\anaconda\envs\pymc3_env5\lib\site-packages\pymc3\sampling.py”, line 1480, in _mp_sample
sampler = ps.ParallelSampler(
File “C:\Users\deepakkapoor\anaconda\envs\pymc3_env5\lib\site-packages\pymc3\parallel_sampling.py”, line 423, in init
step_method_pickled = pickle.dumps(step_method, protocol=-1)
TypeError: cannot pickle ‘fortran’ object”

Things I have tried so far →

  1. Setting cores = 1
  2. Updating joblib
  3. Installing pymc3 using this link : Installation Guide (Linux) · pymc-devs/pymc Wiki · GitHub