Skip to content
This repository has been archived by the owner on Jul 1, 2024. It is now read-only.

K.gather not working for Embedding Layer using MXNet backend #63

Closed
roywei opened this issue Apr 5, 2018 · 1 comment
Closed

K.gather not working for Embedding Layer using MXNet backend #63

roywei opened this issue Apr 5, 2018 · 1 comment

Comments

@roywei
Copy link

roywei commented Apr 5, 2018

In Keras Embedding layer, K.gather operator is used (MXNet backend use mx.sym.take and TensorFlow backend use tf.gather for implementation). However, K.gather is giving error when using MXNet backend, and this issue only occurs in Embedding layer use case, not in other use cases.
Test Case:
tests/keras/layers/embeddings_test.py
Error Message:
Error in operator broadcast_mul0: [13:05:25] src/operator/tensor/./elemwise_binary_broadcast_op.h:67: Check failed: l == 1 || r == 1 operands could not be broadcast together with shapes [3,2] [3]
This PR fixed it and is using directly mx.sym.Embedding instead of K.gather to implement the Keras Embedding Layer. Note this fix will break original Keras code and have conflict in future merge.

@sandeep-krishnamurthy
Copy link

Closing in favor of - #18

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants