snorkel-team / snorkel

A system for quickly generating training data with weak supervision
https://snorkel.org
Apache License 2.0
5.81k stars 857 forks source link

UserWarning with TextRNN #763

Closed regoldman closed 7 years ago

regoldman commented 7 years ago

Running into the following warning when using the TextRNN function:

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. "

The function runs quite slow with a larger dataset. Any advice would be helpful.

henryre commented 7 years ago

Hi @regoldman. The call to tf.nn.embedding_lookup throws this because the embedding table is a combination of a fixed Tensor and a Variable. It shouldn't significantly impact performance. The long training times you're seeing are likely just a result of running an RNN over long sentences on a large dataset. You can try reducing the maximum sentence length or the embedding size.