Closed DavidNemeskey closed 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:
swap_memory=True
in tf.nn.dynamic_rnn()
. This moves activations computed during the forward pass from GPU to CPU, and move them back for the backward pass.I hope this helps and please let me know if there are any other questions.
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?