[英]TypeError: function() got an unexpected keyword argument 'njobs'
I am working on a basic example of MCMC sampling for Bayesian estimation using PyMC3.我正在研究使用 PyMC3 进行贝叶斯估计的 MCMC 采样的基本示例。 I have a minimally working example of my code below:
我在下面的代码中有一个最低限度的工作示例:
# Establish the parameters of the model
p_a = .15
N = 150
n_successes_a = np.random.binomial(N, p_a)
# Build a model using the uniform prior and binomial
with pm.Model() as Model:
# Prior on p
prob = pm.Uniform('p')
# Binomial likelihood
y = pm.Binomial('y', n=N, p=prob, observed=n_successes_a)
# Begin to sample from the posterior distribution
with Model:
samples = pm.sample(2000, njobs=1)
Then when I run this, I get the error: TypeError: function() got an unexpected keyword argument 'njobs'
然后当我运行这个时,我得到错误:
TypeError: function() got an unexpected keyword argument 'njobs'
Any insight as to why this might be happening?关于为什么会发生这种情况的任何见解? I have not been able to find anything online elsewhere providing a substantiative answer.
我无法在其他地方在线找到任何提供实质性答案的内容。
Thanks.谢谢。
From https://docs.pymc.io/api/inference.html?highlight=sample#pymc3.sampling.sample来自https://docs.pymc.io/api/inference.html?highlight=sample#pymc3.sampling.sample
sample()
doesn't accept a njobs
argument. sample()
不接受njobs
参数。 I'm guessing you meant to be setting the cores
argument我猜你是想设置
cores
参数
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.