简体   繁体   English

类型错误:function() 得到了一个意外的关键字参数“njobs”

[英]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.

相关问题 TypeError:得到一个意外的关键字参数 - TypeError: got an unexpected keyword argument TypeError: defined function got an unexpected keyword argument 'many - TypeError: defined function got an unexpected keyword argument 'many TypeError:得到了意外的关键字参数“ name” - TypeError: got an unexpected keyword argument “name” 类型错误:binarySearch() 得到了一个意外的关键字参数“key” - TypeError: binarySearch() got an unexpected keyword argument 'key' TypeError:histogram()得到了意外的关键字参数“ new” - TypeError: histogram() got an unexpected keyword argument 'new' TypeError:urlopen()获得了意外的关键字参数'headers' - TypeError: urlopen() got an unexpected keyword argument 'headers' TypeError:得到了一个意外的关键字参数“图像” - TypeError: got an unexpected keyword argument 'image' TypeError: concatenate() 得到了一个意外的关键字参数“dtype” - TypeError: concatenate() got an unexpected keyword argument 'dtype' TypeError: mannwhitneyu() 得到了一个意外的关键字参数“方法” - TypeError: mannwhitneyu() got an unexpected keyword argument 'method' TypeError: UserCreateForm() 得到了一个意外的关键字参数“初始” - TypeError: UserCreateForm() got an unexpected keyword argument 'initial'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM