当前位置: 代码迷 >> 综合 >> 深度学习框架keras:如何设置后端Tensorflow/theano
  详细解决方案

深度学习框架keras:如何设置后端Tensorflow/theano

热度:21   发布时间:2023-12-18 02:52:40.0

修改keras配置文件,可以更改keras后端依赖的框架:

sudo gedit ~/.keras/keras.json
{"epsilon": 1e-07, "floatx": "float32", "image_data_format":"channels_last" ,"backend": "tensorflow","image_dim_ordering":"th"
}

把tensorflow改为theano,
同时把channels_last改为channels_first,
即可切换后端框架,如下:

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