backstopmedia / tensorflowbook

457 stars 296 forks source link

Sequence classification: GPU runs out of memory #11

Closed DavidNemeskey closed 7 years ago

DavidNemeskey commented 8 years ago

Maybe the behaviour of dynamic_rnn changed, or the author used a graphic card with more memory than me, but on a GTX 980 with 4GB, the sequence classification code doesn't run.

I think the reason is that the length of the longest review is around 2700, and 2700x300xbatch_size is too much for the card. It would be nice if the book addressed this issue.

I guess a solution would be to unroll the network to e.g. 50 steps, but still feed the batches... is it possible?

danijar commented 7 years ago

Hi David, I'm sorry I didn't get a notification about your issue. It's probably too late but in case someone finds this and is looking for a solution, there are several options:

I hope this helps and please let me know if there are any other questions.