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

TypeError: __init__() got multiple values for argument 'num_units' #11

Open
shresthpaul133 opened this issue Mar 6, 2018 · 1 comment

Comments

@shresthpaul133
Copy link

shresthpaul133 commented Mar 6, 2018

Hi,
This is the issue I'm getting after running. Here's the part of the code in which I'm getting issues. I'm using python 3.5 in anaconda and spyder. One more thing, I know I'm using BahdanauAttention, as attention_option was giving error so I changed it to this and then also I was facing many errors so I referred to the tensorflow's guide and found out this and this actually work. But with a small error.

File "E:/CHATBOT/CHATBOT/Chatbot-from-Movie-Dialogue-master/Chatbot_Attention.py", line 439, in decoding_layer_train
num_units=dec_cell.output_size)

def decoding_layer_train(encoder_state, dec_cell, dec_embed_input, sequence_length, decoding_scope,
output_fn, keep_prob, batch_size):
'''Decode the training data'''

attention_states = tf.zeros([batch_size, 1, dec_cell.output_size])


att_keys, att_vals, att_score_fn, att_construct_fn = tf.contrib.seq2seq.BahdanauAttention(attention_states,
                                             name="bahdanau",
                                             num_units=dec_cell.output_size)

train_decoder_fn = tf.contrib.seq2seq.attention_decoder_fn_train(encoder_state[0],
                                                                 att_keys,
                                                                 att_vals,
                                                                 att_score_fn,
                                                                 att_construct_fn,
                                                                 name = "attn_dec_train")
train_pred, _, _ = tf.contrib.seq2seq.dynamic_rnn_decoder(dec_cell, 
                                                          train_decoder_fn, 
                                                          dec_embed_input, 
                                                          sequence_length, 
                                                          scope=decoding_scope)
train_pred_drop = tf.nn.dropout(train_pred, keep_prob)
return output_fn(train_pred_drop)
@NitinSaini18
Copy link

Hey, i am also having error with this code. Can you tell me how you solved it.

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