ageron / ageron/handson-ml2

Chapter 16 - Issue with Encoder-Decoder Network for Neural Machine Translation

Ouverte
#187 4 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Jupyter Notebook
Étoiles
30k
Forks
13.1k
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

Hi,

Really enjoying the book, but I'm encountering a problem when trying to implement the "Encoder-Decoder Network for Neural Machine Translation" in chapter 16.

I'm getting the error below on both my local machine and in the Google Colab notebook:

---------------------------------------------------------------------------

TypeError Traceback (most recent call last)

in ()
21 final_outputs, final_state, final_sequence_lengths = decoder(
22 decoder_embeddings, initial_state=encoder_state,
---> 23 sequence_length=sequence_lengths)
24 Y_proba = tf.nn.softmax(final_outputs.rnn_output)
25

/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/base_layer.py in __call__(self, *args, **kwargs)
920 not base_layer_utils.is_in_eager_or_tf_function()):
921 with auto_control_deps.AutomaticControlDependencies() as acd:
--> 922 outputs = call_fn(cast_inputs, *args, **kwargs)
923 # Wrap Tensors in `outputs` in `tf.identity` to avoid
924 # circular dependencies.

/usr/local/lib/python3.6/dist-packages/tensorflow/python/autograph/impl/api.py in wrapper(*args, **kwargs)
263 except Exception as e: # pylint:disable=broad-except
264 if hasattr(e, 'ag_error_metadata'):
--> 265 raise e.ag_error_metadata.to_exception(e)
266 else:
267 raise

TypeError: in user code:

/usr/local/lib/python3.6/dist-packages/tensorflow_addons/seq2seq/decoder.py:163 call *
self,
/usr/local/lib/python3.6/dist-packages/typeguard/__init__.py:261 wrapper *
check_argument_types(memo)
/usr/local/lib/python3.6/dist-packages/typeguard/__init__.py:668 check_argument_types *
check_type(description, value, expected_type, memo)
/usr/local/lib/python3.6/dist-packages/typeguard/__init__.py:566 check_type *
checker_func(argname, value, expected_type, memo)
/usr/local/lib/python3.6/dist-packages/typeguard/__init__.py:409 check_union *
raise TypeError('type of {} must be one of ({}); got {} instead'.

TypeError: type of argument "training" must be one of (bool, NoneType); got tensorflow.python.framework.ops.Tensor instead

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.