As the title states, I am trying to switch the Keras backend to Theano in order to run a machine learning model but am having some issues. I started by switching the Keras backend to Theano in the .json file as shown below:
{
"floatx": "float32",
"epsilon": 1e-07,
"backend": "theano",
"image_data_format": "channels_last"
}
I also switched the Keras to import directly instead of from Tensorflow and am also importing Theano even though I am unsure if I have to.
import theano
from plivo import plivoxml
import keras
I am reading in my model but when I check the Keras backend remains Tensorflow and is unable to load.
print("Reading in the model now")
print("Keras backend is: ", keras.backend.backend())
model = keras.models.load_model('/home/NudgeStudyChatbot/mysite/lstm')
I get the normal server log messages as if I were to run Keras from Tensorflow and the backend remains Tensorflow.
2021-02-17 22:42:55 Reading in the model now
2021-02-17 22:42:55 Keras backend is: tensorflow
...
2021-02-17 22:42:55 2021-02-17 22:42:55.262148: F tensorflow/core/platform/env.cc:351] Check failed: -1 != path_length (-1 vs. -1)
2021-02-17 22:42:55 !!! uWSGI process 1 got Segmentation Fault !!!
I am hosting the code using a Flask web app with python 3.8. The model being loaded is trained using Keras from Tensorflow, but it takes a while to train so I would prefer not to retrain if possible. Any help or guidance would be greatly appreciated! If more information is needed just let me know!