Loading large numpy array (DAIC-WOZ) for LSTM model causes Out of memory errors
Looking at your code, it looks like you're using Keras w/ a Tensorflow backend -- or Tensorflow functions using its Keras submodule. In that case, you can train your model using its fit_generator function.
As the name implies, if you convert your training data into a generator, it will substantially reduce the memory cost needed to train your model. Here's an example of training a Keras model using fit_generator and how you can preprocess your data to utilize it.