2017-06-06 25 views
1

我在使用tf.boolean_mask()得到這個UserWarning:獲取UserWarning而我用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. " 

一旦我刪除它,警告味精消失。我發現this answer,但我沒有使用tf.gather(),我確信我通過了tf.Variabletf.placeholdertf.nn.embedding_lookup()。那麼我如何解決這個問題呢?

感謝您的幫助!

回答

0

同樣在這裏,由於tf.boolean_mask()得到了這個錯誤。看圖,你可以看到boolean_mask函數實際上包含對tf.gather()的調用。

遵循AI_ROBOT在the answer you mentioned中提出的建議,即使用dynamic_partition()而不是boolean_mask(),爲我做了訣竅!