简体   繁体   中英

keras backend theano/tensorflow

I have an issue using keras backend. I set up tensorflow as the backend. I check the ./keras/keras.json, the activate.d and activate.sh to have tensorflow as backend. I also tried to force the envs variable to tensorflow.
The first time a run keras on the jupyter, it works fine. I can also import tensorflow without any bugs.

However when I use jupyter notebook now, the backend is theano.

I try to import keras on ipython and the backend is tensorflow.

I install keras, tensorflow and theano with conda.

python version : 3.6

keras : 2.0.6

tensorflow : 1.3.0

theano : 0.9

OS : win10

I try different ways to change the backend to tensorflow for jupyter notebook but it does not seem to work.

Usually, with conda, we create specific environments that are (theoretically) independent from the others.

I suggest you create a tensorflow environment using conda. Using the command prompt:

conda create -n myTensorflowEnv python=3.5

And then you activate this environment:

activate myTensorflowEnv

The name of your environment should then appear in between parentheses at the beginning of the command prompt. (In case this doesn't work, you may need to setup some vars: How to activate an Anaconda environment )

Inside this environment, you install everything you need: Tensorflow, keras and other dependencies. This process will depend on what you want, though, cpu, gpu, compilations, etc.

You should probably install jupyter in this environment as well. (And perhaps -- only if you have the terrible bug I mentioned in my comment -- uninstall the other jupyters first).

If everything goes well, you will be able to use tensorflow in this environment if you run jupyter from this environment.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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