简体   繁体   English

TypeError:backward()得到了一个意外的关键字参数“变量”

[英]TypeError: backward() got an unexpected keyword argument 'variables'

I am using the recurrent Gaussian Process library .我正在使用循环高斯过程库 I believe the code is developed by older versions of python and pytorch.我相信代码是由旧版本的 python 和 pytorch 开发的。 I ran one of the experiments of the model after cloning the repository克隆存储库后,我进行了模型的一项实验

python ./testing/rnn_rgp_test.py

I got this error message from this line of the rnn_encoder.py script :我从rnn_encoder.py 脚本的这一行收到此错误消息:

./RGP/autoreg/rnn_encoder.py", line 274, in backward_computation
    torch.autograd.backward( variables=self.forward_means_list + self.forward_vars_list, 
TypeError: backward() got an unexpected keyword argument 'variables'

I will be grateful if someone can point out how I can fix this error?如果有人能指出我如何解决此错误,我将不胜感激?

Version 0.3.1 of PyTorch seems to be the last version with the variables parameter. PyTorch 的0.3.1版本似乎是最后一个带有variables参数的版本。 Ideally, the RGP library should have documented which version of their dependencies they use but they didn't.理想情况下,RGP 库应该记录他们使用的依赖项的哪个版本,但他们没有。 Given that their Git repo seems to be inactive, you have several choices:鉴于他们的 Git 存储库似乎处于非活动状态,您有多种选择:

  1. Use old versions of whatever libraries they require.使用他们需要的任何库的旧版本。 You will have to go from one error to the next, hoping that things work as intended.您将不得不从一个错误转到下一个错误,希望事情能按预期工作。
  2. Fork RGP and re-implement the logic with current libraries. Fork RGP 并使用当前库重新实现逻辑。 This will likely involve significant coding and may not even be possible at all.这可能会涉及大量编码,甚至可能根本不可能。
  3. Try to find a different library that implements RGPs.尝试找到实现 RGP 的不同库。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 TypeError:backward() 在 pytorch 中有一个意外的关键字参数“grad_tensors” - TypeError: backward() got an unexpected keyword argument 'grad_tensors' in pytorch TypeError:open()获得了意外的关键字参数“缓冲” - TypeError: open() got an unexpected keyword argument 'buffering' 类型错误:contact() 得到了意外的关键字参数“name” - TypeError: contact() got an unexpected keyword argument 'name' TypeError at &#39;&#39; __init__() 得到一个意外的关键字参数 &#39;&#39; - TypeError at '' __init__() got an unexpected keyword argument '' TypeError:getresponse()得到一个意外的关键字参数'buffering' - TypeError: getresponse() got an unexpected keyword argument 'buffering' TypeError:urlopen()获得了意外的关键字参数&#39;headers&#39;_Python3 - TypeError: urlopen() got an unexpected keyword argument 'headers'_Python3 初学者:类型错误:<lambda> () 得到了一个意外的关键字参数 &#39;func_names&#39; - Beginner: TypeError: <lambda>() got an unexpected keyword argument 'func_names' 类型错误:__init__() 得到了一个意外的关键字参数“平均” - TypeError: __init__() got an unexpected keyword argument 'average' TypeError:__ init __()得到一个意外的关键字参数&#39;log_dir&#39; - TypeError: __init__() got an unexpected keyword argument 'log_dir' TypeError:__init __()获得了意外的关键字参数&#39;param_distributions&#39; - TypeError: __init__() got an unexpected keyword argument 'param_distributions'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM