Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Concatenate two AttentionDecoders raise ValueError #44

Open
bagustris opened this issue Mar 27, 2019 · 1 comment
Open

Concatenate two AttentionDecoders raise ValueError #44

bagustris opened this issue Mar 27, 2019 · 1 comment

Comments

@bagustris
Copy link

Hi,

I have two networks that I want to concatenate. So, here is the piece of code

...
a = Bidirectional(LSTM(256, return_sequences=True))(input_a)
a = AttentionDecoder(128, 128)(a)
...
b = Bidirectional(LSTM(256, return_sequences=True))(input_b)
b = AttentionDecoder(128, 128)(b)
...
c = concatenate([a, b])
d = Model([input_a, input_b], c) 

This raise ValueError: The name "AttentionDecoder" is used 2 times in the model. All layer names should be unique.

Any idea how to deal with this problem? I already comment name=AttentionDecoder inside the class/funcion.

@bagustris bagustris changed the title Concatenate two AttentionDecoder raise ValueError: The name "AttentionDecoder" is used 2 times in the model. All layer names should be unique. Concatenate two AttentionDecoders raise ValueError Jun 5, 2019
@BigWheel92
Copy link

BigWheel92 commented Nov 24, 2019

It's late but I hope it can help someone else: uncomment name='AttentionDecoder' inside the class, and then do the following while using AttentionDecoder class:

...
a = Bidirectional(LSTM(256, return_sequences=True))(input_a)
a = AttentionDecoder(128, 128, name='AttentionDecoder1')(a)
...
b = Bidirectional(LSTM(256, return_sequences=True))(input_b)
b = AttentionDecoder(128, 128, name='AttentionDecoder2')(b)
...
c = concatenate([a, b])
d = Model([input_a, input_b], c)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants