TypeError: call() got an unexpected keyword argument 'intitial_state'

Hi All,

I’m getting the following Error on Course 5, Week 3’s assignment. Does anyone have any tips?

ERROR:


TypeError Traceback (most recent call last)
in
34
35
—> 36 modelf_test(modelf)

in modelf_test(target)
11
12
—> 13 model = target(Tx, Ty, n_a, n_s, len_human_vocab, len_machine_vocab)
14
15 print(summary(model))

in modelf(Tx, Ty, n_a, n_s, human_vocab_size, machine_vocab_size)
43 # Step 2.B: Apply the post-attention LSTM cell to the “context” vector.
44 # Don’t forget to pass: initial_state = [hidden state, cell state] (≈ 1 line)
—> 45 s, _, c = post_activation_LSTM_cell(inputs=context, intitial_state=[s,c])
46
47 # Step 2.C: Apply Dense layer to the hidden state output of the post-attention LSTM (≈ 1 line)

/opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/layers/recurrent.py in call(self, inputs, initial_state, constants, **kwargs)
661
662 if initial_state is None and constants is None:
→ 663 return super(RNN, self).call(inputs, **kwargs)
664
665 # If any of initial_state or constants are specified and are Keras

/opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/engine/base_layer.py in call(self, *args, **kwargs)
924 if _in_functional_construction_mode(self, inputs, args, kwargs, input_list):
925 return self._functional_construction_call(inputs, args, kwargs,
→ 926 input_list)
927
928 # Maintains info about the Layer.call stack.

/opt/conda/lib/python3.7/site-packages/tensorflow/python/keras/engine/base_layer.py in _functional_construction_call(self, inputs, args, kwargs, input_list)
1115 try:
1116 with ops.enable_auto_cast_variables(self._compute_dtype_object):
→ 1117 outputs = call_fn(cast_inputs, *args, **kwargs)
1118
1119 except errors.OperatorNotAllowedInGraphError as e:

TypeError: call() got an unexpected keyword argument ‘intitial_state’

Disregard. I found it. It was a type-o with the word initial…

—> 45 s, _, c = post_activation_LSTM_cell(inputs=context, intitial_state=[s,c])

. kindly help. i face this same issue

Your problem seems related to NLP specialization. Please follow community user guide and create a new topic under the right subcategory.