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.
In case you don’t want the default BLAS with Theano (due to various reasons such as memory leak or speed), you can install OpenBLAS as an alternative.
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.
Written on June 27, 2017