keras ignoring values in $HOME/.keras/keras.json file

帅比萌擦擦* 提交于 2019-12-04 02:54:48

Same issue here, system setup:

  • Ubuntu 16.04
  • Anaconda + Python 3.6
  • Keras 2.0.2

The only way to change backend is to use KERAS_BACKEND environment variable. Json field is ignored.

EDIT: The issue is Anaconda, open anaconda3/envs/ENV-NAME/etc/conda/activate.d/keras_activate.sh

#!/bin/bash
if [ "$(uname)" == "Darwin" ]
then
    # for Mac OSX
    export KERAS_BACKEND=tensorflow
elif [ "$(uname)" == "Linux" ]
then
    # for Linux
    export KERAS_BACKEND=theano
fi

You'll see that tensorflow is forced for MAC, and Theano for Linux.

I have no idea who creates this file, keras or anaconda, and the reasoning behind this forcing. I'm just ignoring it and doing my own way:)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!