简体   繁体   English

Keras使用theano后端,尽管keras.json指定了tensorflow

[英]Keras using theano backend despite keras.json specifying tensorflow

Keras is using theano as a backend despite the .keras/keras.json file specifying tensorflow. 尽管.keras / keras.json文件指定了tensorflow,但Keras使用theano作为后端。

(conda_env) [centos@ip ~]$ cat .keras/keras.json
{
    "epsilon": 1e-07, 
    "floatx": "float32", 
    "image_data_format": "channels_first", 
    "backend": "tensorflow"
}

Python 2.7.15 | packaged by conda-forge | (default, Nov 28 2018, 18:42:13) 
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import keras
Using Theano backend.

I have tensorflow installed and can import it without a problem. 我已经安装了tensorflow,可以毫无问题地将其导入。 Where is keras getting the command to use theano as a backend and how can I change it? keras在哪里得到使用theano作为后端的命令,我该如何更改?

The issue is with anaconda, which is using its own file to determine the backend. 问题出在anaconda,后者正在使用其自己的文件来确定后端。 You'll need to edit that file, which should be located somewhere like /home/user/anaconda/envs/my_env/etc/conda/activate.d/keras_activate.sh 您需要编辑该文件,该文件应位于/home/user/anaconda/envs/my_env/etc/conda/activate.d/keras_activate.sh

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM