2

Recently I am using a CNN to do text classification which is described in http://www.wildml.com/2015/12/implementing-a-cnn-for-text-classification-in-tensorflow/.

My dataset is quite large and the vocabulary size is more than 1M words. My training algorithm becomes much slower when the vocabulary size gets bigger. There is a warning message saying that "....tensorflow/python/ops/gradients.py:87: UserWarning: Converting sparse IndexedSlices to a dense Tensor with 145017088 elements. This may consume a large amount of memory."

I am thinking this may be caused by a dense gradient update on the embedding matrix. Does anyone have any ideas on that? There is a post Update only part of the word embedding matrix in Tensorflow discussing similar issue. The top answer states that tensorflow only updates specific rows. Why did it change in my case?

Thanks!

0 Answers0