When I am trying to run this
import keras
I am getting following error:
Traceback (most recent call last):
File "<ipython-input-1-c74e2bd4ca71>", line 1, in <module>
import keras
File "/Users/rezwan/anaconda/lib/python3.6/site-packages/keras/__init__.py", line 3, in <module>
from . import utils
File "/Users/rezwan/anaconda/lib/python3.6/site-packages/keras/utils/__init__.py", line 6, in <module>
from . import conv_utils
File "/Users/rezwan/anaconda/lib/python3.6/site-packages/keras/utils/conv_utils.py", line 3, in <module>
from .. import backend as K
File "/Users/rezwan/anaconda/lib/python3.6/site-packages/keras/backend/__init__.py", line 83, in <module>
from .tensorflow_backend import *
File "/Users/rezwan/anaconda/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 2, in <module>
from tensorflow.python.training import moving_averages
ModuleNotFoundError: No module named 'tensorflow.python.training'
Already I have installed Theano
, Tensorflow
and Keras
through the following commands:
Theano:
Rezwans-iMac:~ rezwan$ pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git
Tensorflow:
Rezwans-iMac:~ rezwan$ conda create -n tensorflow python=3.6
Rezwans-iMac:~ rezwan$ source activate tensorflow
(tensorflow) Rezwans-iMac:~ rezwan$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.3.0rc2-py3-none-any.whl
(tensorflow) Rezwans-iMac:~ rezwan$ pip3 install --upgrade $TF_BINARY_URL
Keras:
Rezwans-iMac:~ rezwan$ pip install --upgrade keras
Above commands work properly.
But I am getting above error. How can I solve this error?
keras
is in/Users/rezwan/anaconda/lib/python3.6/site-packages/keras
, there is no issue with python2 visible here – Scandium