实验室新装了keras,发现keras默认后端是tensorflow,想换回theano,看了官方文档也没搞懂,最终搞定,很简单。
中文文档的描述: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"
}

最后保存就可以了

GitHub 加速计划 / te / tensorflow
20
4
下载
一个面向所有人的开源机器学习框架
最近提交(Master分支:1 个月前 )
4f64a3d5 Instead, check for this case in `ResolveUsers` and `ResolveOperand`, by querying whether the `fused_expression_root` is part of the `HloFusionAdaptor`. This prevents us from stepping into nested fusions. PiperOrigin-RevId: 724311958 1 个月前
aa7e952e Fix a bug in handling negative strides, and add a test case that exposes it. We can have negative strides that are not just -1, e.g. with a combining reshape. PiperOrigin-RevId: 724293790 1 个月前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐