rgsachin / CoVe

Keras implementation of CoVe
BSD 3-Clause "New" or "Revised" License
51 stars 11 forks source link

cove_model.predict with Tensor input #1

Open deeplearningmachine opened 6 years ago

deeplearningmachine commented 6 years ago

How can we use the output from tf.nn.embedding_lookup() in Tensorflow as the input to the cove_model.predict method?

deeplearningmachine commented 6 years ago

when I tried: emb = tf.nn.embedding_lookup(word_mat, sentences) emb = cove_model.predict(emb) I got File ".../lib/python3.4/site-packages/keras/engine/training.py", line 76, in data = [np.expand_dims(x, 1) if x is not None and x.ndim == 1 else x for x in data] AttributeError: 'Tensor' object has no attribute 'ndim'

Any idea?

Thanks!