While running some LSTM experiments in Keras the code ran into memory leak, which turned out to be an issue of Theano and BLAS hook up. Here is the solution I found.
Below is a summary from here for Windows:
Create a directory to put OpenBLAS,
Copy the DLLs from
- Add to following lines to your
[blas] ldflags = -LC:\openblas -lopenblas
- Run check_blas.py for verification:
import os, theano total_path = os.path.join(os.path.dirname(theano.__file__), "misc", "check_blas.py") os.system("python " + total_path)
If there is a more principled way to do this (e.g., via conda or pip install), please let me know.