I am trying to get Theano to run with Keras on a Raspberry Pi 3 (B) without success. I tried Ubuntu MATE and Raspbian as operating systems, without success. To install Theano and Keras, I have taken following steps:
- Install miniconda (armv7 distribution)
- Install all Theano dependencies (as shown here) through Conda (if possible),
pip
andapt-get
- Install Theano
- Install Keras
The aforementioned steps work without any issues. In the next step, I built a little test script (test.py) which loads an already built model via
from keras.models import load_model
model = load_model('model.hdf5')
When the model is being loaded, I get the following error
Segmentation fault (core dumped)
Then I tried to investigate the issue further, following this answer on SO (What causes a Python segmentation fault?):
gdb python
> run test.py
When I run this I get:
Program received SIGSEV, Segmentation fault.
0x76fd9822 in ?? () from /lib/ld-linux-armhf.so.3
In the next step I ran in the gdb shell:
> backtrace
and got
#0 0x76fd9822 in ?? () from /lib/ld-linux-armhf.so.3
#1 0x76fd983a in ?? () from /lib/ld-linux-armhf.so.3
this is the point where I don't know any further and I would like to ask, if anyone could point me into a direction on how to fix this issue and get keras + theano to run on a Raspberry Pi.
(I have also tried TensorFlow as an alternative, but getting the same issue)
Thanks a lot.
EDIT
I have done some more investigations. If I run Keras with TensorFlow the problem seems to change a little bit. I ran gdb again, but the error happens now in numpy, especially in libopenblas.so.0
Program received signal SIGSEV, Segmentation fault.
0x75ead7cc in inner_thread()
from /home/<path>/numpy/core/../../../../libopenblas.so.0
Does this help?
EDIT 2
I have installed everything without using Miniconda and Keras works now with TensorFlow (but not with Theano yet).
bazel build -c dbg
to build it. – BlandishKERAS_BACKEND=theano python yourmodel.py
? – Foucault