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

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.

主站蜘蛛池模板: 阜平县| 舒兰市| 沙雅县| 九江县| 通榆县| 徐水县| 环江| 克拉玛依市| 东港市| 余江县| 浮梁县| 湘潭市| 霞浦县| 阿巴嘎旗| 吉首市| 沛县| 五原县| 吉木萨尔县| 思南县| 青冈县| 中西区| 乌拉特前旗| 格尔木市| 武穴市| 北辰区| 佛冈县| 乐东| 磐石市| 凤阳县| 呈贡县| 涟水县| 广南县| 巴林左旗| 荔浦县| 新河县| 雷山县| 朔州市| 安远县| 溧阳市| 临漳县| 榆树市|