Ghrua
Ghrua

Reputation: 7666

Get UserWarning while I use tf.boolean_mask

I got this UserWarning while using tf.boolean_mask():

/usr/local/lib/python2.7/site-packages/tensorflow/python/ops/gradients_impl.py:93: UserWarning: Converting sparse IndexedSlices to a dense Tensor of unknown shape. This may consume a large amount of memory.
  "Converting sparse IndexedSlices to a dense Tensor of unknown shape. "

Once I remove it, the warning msg disappear. I find this answer, but I don't use tf.gather() and I am sure I pass the tf.Variable and tf.placeholder to tf.nn.embedding_lookup(). So how could I fix this problem?

thanks for your help !

Upvotes: 1

Views: 1023

Answers (1)

Bertrand HIGY
Bertrand HIGY

Reputation: 26

Same here, got this error due to tf.boolean_mask(). Looking at the graph, you can see that the boolean_mask function actually includes a call to tf.gather().

Following the suggestion made by AI_ROBOT in the answer you mentioned, that is using dynamic_partition() instead of boolean_mask(), did the trick for me!

Upvotes: 1

Related Questions