Skip to content Skip to sidebar Skip to footer

Tensorflow And Word Embeddings - Typeerror: Unhashable Type: 'numpy.ndarray'

I wish to modify the code at http://www.brightideasinanalytics.com/rnn-pretrained-word-vectors/, which is about predicting the next word, to have code that predicts answers to ques

Solution 1:

The problem occurs here: y: tf.nn.embedding_lookup(W, y). The feed_dict keys should be placeholders from the TensorFlow graph. Assuming that y is a numpy.ndarray containing the target values, you could define a tf.placeholder y_ to feed the target values into the network, changing the corresponding entry of feed_dict to y_: tf.nn.embedding_lookup(W, y) and modifying the other tensors accordingly (i.e. use tensor y_ to compute the loss).


Post a Comment for "Tensorflow And Word Embeddings - Typeerror: Unhashable Type: 'numpy.ndarray'"