当前位置:   article > 正文

【Error】TypeError: forward() got an unexpected keyword argument 'inputs'_typeerror: add_update() got an unexpected keyword

typeerror: add_update() got an unexpected keyword argument 'inputs

报错信息

Traceback (most recent call last): 

  File "main_batch.py", line 51, in train
    results = Decoder(inputs=out_sents_, encoder_hidden=en_hidden, encoder_outputs=en_output)
  File "/users4/zsun/.local/lib/python3.6/site-packages/torch/nn/modules/module.py", line 206, in __call__
    result = self.forward(*input, **kwargs)

TypeError: forward() got an unexpected keyword argument 'inputs'

 

看到这篇文章:http://blog.csdn.net/u012965373/article/details/53689237

更改为:results = Decoder(input=out_sents_, encoder_hidden=en_hidden, encoder_outputs=en_output)

仍然报错:TypeError: forward() got an unexpected keyword argument 'input'

 

更改为:

results = Decoder(out_sents_, en_hidden) #, encoder_outputs=en_output

错误解决。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/凡人多烦事01/article/detail/286478
推荐阅读
相关标签
  

闽ICP备14008679号