{"action":"created","issue":{"url":"https://api.github.com/repos/keras-team/keras/issues/6545","repository_url":"https://api.github.com/repos/keras-team/keras","labels_url":"https://api.github.com/repos/keras-team/keras/issues/6545/labels{/name}","comments_url":"https://api.github.com/repos/keras-team/keras/issues/6545/comments","events_url":"https://api.github.com/repos/keras-team/keras/issues/6545/events","html_url":"https://github.com/keras-team/keras/issues/6545","id":227154988,"number":6545,"title":"Import Error with Tensorflow as Backend","user":{"login":"stephenhky","id":3810067,"avatar_url":"https://avatars0.githubusercontent.com/u/3810067?v=4","gravatar_id":"","url":"https://api.github.com/users/stephenhky","html_url":"https://github.com/stephenhky","followers_url":"https://api.github.com/users/stephenhky/followers","following_url":"https://api.github.com/users/stephenhky/following{/other_user}","gists_url":"https://api.github.com/users/stephenhky/gists{/gist_id}","starred_url":"https://api.github.com/users/stephenhky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephenhky/subscriptions","organizations_url":"https://api.github.com/users/stephenhky/orgs","repos_url":"https://api.github.com/users/stephenhky/repos","events_url":"https://api.github.com/users/stephenhky/events{/privacy}","received_events_url":"https://api.github.com/users/stephenhky/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2017-05-08T19:52:49Z","updated_at":"2018-05-24T06:18:24Z","closed_at":"2017-05-09T13:41:57Z","author_association":"NONE","body":"I ran with the latest version of tensorflow and keras. I didn't experience an import problem with theano as the backend. And when I put tensorflow as the backend, I saw the following message:\r\n\r\n`\r\nIn [1]: import keras\r\nUsing TensorFlow backend.\r\n---------------------------------------------------------------------------\r\nAttributeError                            Traceback (most recent call last)\r\n<ipython-input-1-c74e2bd4ca71> in <module>()\r\n----> 1 import keras\r\n\r\n//anaconda/lib/python2.7/site-packages/keras/__init__.py in <module>()\r\n      1 from __future__ import absolute_import\r\n      2\r\n----> 3 from . import activations\r\n      4 from . import applications\r\n      5 from . import backend\r\n\r\n//anaconda/lib/python2.7/site-packages/keras/activations.py in <module>()\r\n      4 from . import backend as K\r\n      5 from .utils.generic_utils import deserialize_keras_object\r\n----> 6 from .engine import Layer\r\n      7\r\n      8\r\n\r\n//anaconda/lib/python2.7/site-packages/keras/engine/__init__.py in <module>()\r\n      6 from .topology import Layer\r\n      7 from .topology import get_source_inputs\r\n----> 8 from .training import Model\r\n\r\n//anaconda/lib/python2.7/site-packages/keras/engine/training.py in <module>()\r\n     22 from .. import metrics as metrics_module\r\n     23 from ..utils.generic_utils import Progbar\r\n---> 24 from .. import callbacks as cbks\r\n     25 from ..legacy import interfaces\r\n     26\r\n\r\n//anaconda/lib/python2.7/site-packages/keras/callbacks.py in <module>()\r\n     24 if K.backend() == 'tensorflow':\r\n     25     import tensorflow as tf\r\n---> 26     from tensorflow.contrib.tensorboard.plugins import projector\r\n     27\r\n     28\r\n\r\n//anaconda/lib/python2.7/site-packages/tensorflow/contrib/__init__.py in <module>()\r\n     28 from tensorflow.contrib import deprecated\r\n     29 from tensorflow.contrib import distributions\r\n---> 30 from tensorflow.contrib import factorization\r\n     31 from tensorflow.contrib import framework\r\n     32 from tensorflow.contrib import graph_editor\r\n\r\n//anaconda/lib/python2.7/site-packages/tensorflow/contrib/factorization/__init__.py in <module>()\r\n     22 from tensorflow.contrib.factorization.python.ops.clustering_ops import *\r\n     23 from tensorflow.contrib.factorization.python.ops.factorization_ops import *\r\n---> 24 from tensorflow.contrib.factorization.python.ops.gmm import *\r\n     25 from tensorflow.contrib.factorization.python.ops.gmm_ops import *\r\n     26 # pylint: enable=wildcard-import\r\n\r\n//anaconda/lib/python2.7/site-packages/tensorflow/contrib/factorization/python/ops/gmm.py in <module>()\r\n     25 from tensorflow.contrib.framework.python.framework import checkpoint_utils\r\n     26 from tensorflow.contrib.framework.python.ops import variables\r\n---> 27 from tensorflow.contrib.learn.python.learn.estimators import estimator\r\n     28 from tensorflow.contrib.learn.python.learn.estimators import model_fn as model_fn_lib\r\n     29 from tensorflow.python.framework import constant_op\r\n\r\n//anaconda/lib/python2.7/site-packages/tensorflow/contrib/learn/__init__.py in <module>()\r\n     85\r\n     86 # pylint: disable=wildcard-import\r\n---> 87 from tensorflow.contrib.learn.python.learn import *\r\n     88 # pylint: enable=wildcard-import\r\n     89\r\n\r\n//anaconda/lib/python2.7/site-packages/tensorflow/contrib/learn/python/__init__.py in <module>()\r\n     21\r\n     22 # pylint: disable=wildcard-import\r\n---> 23 from tensorflow.contrib.learn.python.learn import *\r\n     24 # pylint: enable=wildcard-import\r\n\r\n//anaconda/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/__init__.py in <module>()\r\n     23 from tensorflow.contrib.learn.python.learn import basic_session_run_hooks\r\n     24 from tensorflow.contrib.learn.python.learn import datasets\r\n---> 25 from tensorflow.contrib.learn.python.learn import estimators\r\n     26 from tensorflow.contrib.learn.python.learn import graph_actions\r\n     27 from tensorflow.contrib.learn.python.learn import learn_io as io\r\n\r\n//anaconda/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/estimators/__init__.py in <module>()\r\n    295 from tensorflow.contrib.learn.python.learn.estimators._sklearn import NotFittedError\r\n    296 from tensorflow.contrib.learn.python.learn.estimators.constants import ProblemType\r\n--> 297 from tensorflow.contrib.learn.python.learn.estimators.dnn import DNNClassifier\r\n    298 from tensorflow.contrib.learn.python.learn.estimators.dnn import DNNEstimator\r\n    299 from tensorflow.contrib.learn.python.learn.estimators.dnn import DNNRegressor\r\n\r\n//anaconda/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/estimators/dnn.py in <module>()\r\n     27 from tensorflow.contrib.layers.python.layers import optimizers\r\n     28 from tensorflow.contrib.learn.python.learn import metric_spec\r\n---> 29 from tensorflow.contrib.learn.python.learn.estimators import dnn_linear_combined\r\n     30 from tensorflow.contrib.learn.python.learn.estimators import estimator\r\n     31 from tensorflow.contrib.learn.python.learn.estimators import head as head_lib\r\n\r\n//anaconda/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/estimators/dnn_linear_combined.py in <module>()\r\n     29 from tensorflow.contrib.layers.python.layers import optimizers\r\n     30 from tensorflow.contrib.learn.python.learn import metric_spec\r\n---> 31 from tensorflow.contrib.learn.python.learn.estimators import estimator\r\n     32 from tensorflow.contrib.learn.python.learn.estimators import head as head_lib\r\n     33 from tensorflow.contrib.learn.python.learn.estimators import model_fn\r\n\r\n//anaconda/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py in <module>()\r\n     47 from tensorflow.contrib.learn.python.learn.estimators import tensor_signature\r\n     48 from tensorflow.contrib.learn.python.learn.estimators._sklearn import NotFittedError\r\n---> 49 from tensorflow.contrib.learn.python.learn.learn_io import data_feeder\r\n     50 from tensorflow.contrib.learn.python.learn.utils import export\r\n     51 from tensorflow.contrib.learn.python.learn.utils import saved_model_export_utils\r\n\r\n//anaconda/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/learn_io/__init__.py in <module>()\r\n     19 from __future__ import print_function\r\n     20\r\n---> 21 from tensorflow.contrib.learn.python.learn.learn_io.dask_io import extract_dask_data\r\n     22 from tensorflow.contrib.learn.python.learn.learn_io.dask_io import extract_dask_labels\r\n     23 from tensorflow.contrib.learn.python.learn.learn_io.dask_io import HAS_DASK\r\n\r\n//anaconda/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/learn_io/dask_io.py in <module>()\r\n     24 try:\r\n     25   # pylint: disable=g-import-not-at-top\r\n---> 26   import dask.dataframe as dd\r\n     27   allowed_classes = (dd.Series, dd.DataFrame)\r\n     28   HAS_DASK = True\r\n\r\n//anaconda/lib/python2.7/site-packages/dask/dataframe/__init__.py in <module>()\r\n      1 from __future__ import print_function, division, absolute_import\r\n      2\r\n----> 3 from .core import (DataFrame, Series, Index, _Frame, map_partitions,\r\n      4                    repartition)\r\n      5 from .io import (from_array, from_bcolz, from_array, from_bcolz,\r\n\r\n//anaconda/lib/python2.7/site-packages/dask/dataframe/core.py in <module>()\r\n     36 return_scalar = '__return_scalar__'\r\n     37\r\n---> 38 pd.computation.expressions.set_use_numexpr(False)\r\n     39\r\n     40\r\n\r\nAttributeError: 'module' object has no attribute 'computation'\r\n`\r\n\r\nHowever, I did not experience any error when simply import tensorflow directly:\r\n\r\n`import tensorflow`"},"comment":{"url":"https://api.github.com/repos/keras-team/keras/issues/comments/391601493","html_url":"https://github.com/keras-team/keras/issues/6545#issuecomment-391601493","issue_url":"https://api.github.com/repos/keras-team/keras/issues/6545","id":391601493,"user":{"login":"akshatk05","id":39399446,"avatar_url":"https://avatars3.githubusercontent.com/u/39399446?v=4","gravatar_id":"","url":"https://api.github.com/users/akshatk05","html_url":"https://github.com/akshatk05","followers_url":"https://api.github.com/users/akshatk05/followers","following_url":"https://api.github.com/users/akshatk05/following{/other_user}","gists_url":"https://api.github.com/users/akshatk05/gists{/gist_id}","starred_url":"https://api.github.com/users/akshatk05/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akshatk05/subscriptions","organizations_url":"https://api.github.com/users/akshatk05/orgs","repos_url":"https://api.github.com/users/akshatk05/repos","events_url":"https://api.github.com/users/akshatk05/events{/privacy}","received_events_url":"https://api.github.com/users/akshatk05/received_events","type":"User","site_admin":false},"created_at":"2018-05-24T06:18:24Z","updated_at":"2018-05-24T06:18:24Z","author_association":"NONE","body":"i have been having a similar error for a while now the error is ModuleNotFoundError: no module named tensorflow.contrib:tensorflow is not a package\r\n\r\ncould someone please help me out with this\r\n"}}
{"actor":{"display_login":"akshatk05"}}