Keras 切换后端(Theano和TensorFlow)

Posted q740052959

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Keras 切换后端(Theano和TensorFlow)相关的知识,希望对你有一定的参考价值。

中文文档的描述:keras中文文档,切换后端

其实就是在C:\Users\75538(75538是我的windos用户名字,找你对应的用户名就行)下有个文件夹.keras,里面有keras.json文件,改一下里面的内容就好了,如果没有文件夹和文件,手动创建就行。

用theano的话,keras.json写入

{
    "image_dim_ordering": "th", 
    "epsilon": 1e-07, 
    "floatx": "float32", 
    "backend": "theano"
}

用thesorflow的话,keras.json写入

{
    "image_dim_ordering": "tf", 
    "epsilon": 1e-07, 
    "floatx": "float32", 
    "backend": "tensorflow"
}

最后保存就可以了

以上是关于Keras 切换后端(Theano和TensorFlow)的主要内容,如果未能解决你的问题,请参考以下文章