In the latest version of Keras, the default backend is tensorflow and image_dim_ordering is tf. You need to change them.
Keras 2.x + TensorFlow
configuration file of Keras: ~/.keras/keras.json
{
"epsilon": 1e-07,
"floatx": "float32",
"image_data_format": "channels_first",
"backend": "tensorflow"
}
Keras 1.2 + Theano
configuration file of Keras: ~/.keras/keras.json
{
"image_dim_ordering": "th",
"epsilon": 1e-07,
"floatx": "float32",
"backend": "theano"
}
Ref: https://keras.io/backend/
In our experiment, we mainly tested on Keras 1.2
and Theano
. If you use Keras 2.x or TensorFlow, please see the following discussions: