keras is a convinient deep learing package. so i try to use it to apply lstm. but if you want keras use gpu ,you need to config ~/.theanorc
[global] floatX = float32 device = gpu0 [lib] cnmem = 1
and the time before training is started is a little bit longer than using cpu.