官术网_书友最值得收藏!

Using the Theano backend with Keras

  1. Let's modify the default configuration and change TensorFlow to Theano as the backend of Keras. Modify the keras.json file:
vi .keras/keras.json

The default file has the following content:

{ "image_data_format": "channels_last", 
"
epsilon": 1e-07,
"
floatx": "float32",
"
backend": "tensorflow"
}
  1. The modified file will look like the following file. The "backend" value has been changed to "theano":
{ "image_data_format": "channels_last", 
"
epsilon": 1e-07,
"
floatx": "float32",
"
backend": "theano"
}
  1. Run the Python console and import Sequential from keras.model using the Theano backend:
$ python
Python 2.7.14 |Anaconda, Inc.| (default, Oct 16 2017, 17:29:19)
[GCC 7.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from keras.models import Sequential

Notice how the backend has changed to Theano.

We have installed miniconda, all the dependencies of TensorFlow, and Theano. This was followed by installing TensorFlow and Theano itself. Finally, we installed Keras. We also learned how to change the backend of Keras from TensorFlow to Theano.

主站蜘蛛池模板: 会理县| 临安市| 高邑县| 九寨沟县| 米脂县| 稷山县| 铜山县| 金寨县| 锡林浩特市| 和政县| 鄯善县| 海南省| 吉首市| 京山县| 通河县| 石柱| 札达县| 耒阳市| 横峰县| 山阴县| 河西区| 沐川县| 平定县| 横山县| 武平县| 福海县| 湘阴县| 秦安县| 溧水县| 丹棱县| 台中市| 河西区| 望奎县| 临武县| 桃园县| 达拉特旗| 武宁县| 乌兰县| 准格尔旗| 大埔县| 榆社县|