[英]TypeError: __init__() got multiple values for argument 'axes'
I want to use attention mechanism with the code bellow:我想在下面的代码中使用注意机制:
attention = Dot([decoder_outputs, encoder_outputs], axes=[2, 1])
attention = Activation('softmax')(attention)
context = Dot([attention, encoder_outputs], axes=[2,1])
decoder_combined_context = concatenate([context, decoder_outputs])
But i have this error message and i don't know how to fix it但我有这个错误信息,我不知道如何解决它
Traceback (most recent call last):
attention = Dot([decoder_outputs, encoder_outputs], axes=[2, 1])
TypeError: __init__() got multiple values for argument 'axes'
I'm using keras version 2.3.1 with tensorflow version 2.1.0我正在使用 keras 版本 2.3.1 和 tensorflow 版本 2.1.0
You are not calling the layer correctly, it should be like this:您没有正确调用图层,它应该是这样的:
attention = Dot(axes=[2, 1])([decoder_outputs, encoder_outputs])
Your second call to Dot
has the same issue, it follows the same pattern您对
Dot
的第二次调用有同样的问题,它遵循相同的模式
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.