赞
踩
报错信息
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
错误解决。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。