<p dir="auto">I have installed tensorflow and keras. I have used virtualenviroment given in tensorflow website. It is showing the below error when I try to import keras with tensorflow as backend</p>
<p dir="auto">CPU_COUNT = psutil.cpu_count()<br>
AttributeError: 'module' object has no attribute 'cpu_count'</p>
<p dir="auto">tensorflow version = Version: 1.3.0</p>
<p dir="auto">keras = Version: 2.0.7</p>
<p dir="auto">dask = Version: 0.15.0</p>
<p dir="auto">pandas = Version: 0.20.3</p>
<p dir="auto">For detailed error, attaching the image<br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/18217467/29738791-2213765e-8a4b-11e7-8305-b3fa516097f1.png"><img src="https://user-images.githubusercontent.com/18217467/29738791-2213765e-8a4b-11e7-8305-b3fa516097f1.png" alt="untitled" style="max-width: 100%;"></a></p>
<h3 dir="auto">What related GitHub issues or StackOverflow threads have you found by searching the web for your problem?</h3>
<p dir="auto">Some people report having similar problems with 'module' objects having no attribute something-or-other and claim they were solved by upgrading.</p>
<h3 dir="auto">Environment info</h3>
<p dir="auto">Operating System:<br>
Ubuntu 17.04 x64<br>
Installed version of CUDA and cuDNN:<br>
(please attach the output of <code class="notranslate">ls -l /path/to/cuda/lib/libcud*</code>):</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="-rw-r--r-- 1 root root   558720 сен 15 02:02 /usr/local/cuda/lib64/libcudadevrt.a
-rw-r--r-- 1 root root   383336 дек 23 01:26 /usr/local/cuda/lib64/libcudart.so
-rw-r--r-- 1 root root   383336 дек 23 01:25 /usr/local/cuda/lib64/libcudart.so.7.5
lrwxrwxrwx 1 root root       19 дек 23 02:17 /usr/local/cuda/lib64/libcudart.so.8.0 -&gt; libcudart.so.8.0.44
-rw-r--r-- 1 root root   415432 сен 15 02:02 /usr/local/cuda/lib64/libcudart.so.8.0.44
-rw-r--r-- 1 root root   775162 сен 15 02:02 /usr/local/cuda/lib64/libcudart_static.a
lrwxrwxrwx 1 root root       13 дек 23 02:17 /usr/local/cuda/lib64/libcudnn.so -&gt; libcudnn.so.5
lrwxrwxrwx 1 root root       17 дек 23 02:17 /usr/local/cuda/lib64/libcudnn.so.5 -&gt; libcudnn.so.5.1.5
-rwxr-xr-x 1 root root 79337624 дек 22 04:25 /usr/local/cuda/lib64/libcudnn.so.5.1.5
-rw-r--r-- 1 root root 69756172 дек 22 04:25 /usr/local/cuda/lib64/libcudnn_static.a
"><pre class="notranslate"><code class="notranslate">-rw-r--r-- 1 root root   558720 сен 15 02:02 /usr/local/cuda/lib64/libcudadevrt.a
-rw-r--r-- 1 root root   383336 дек 23 01:26 /usr/local/cuda/lib64/libcudart.so
-rw-r--r-- 1 root root   383336 дек 23 01:25 /usr/local/cuda/lib64/libcudart.so.7.5
lrwxrwxrwx 1 root root       19 дек 23 02:17 /usr/local/cuda/lib64/libcudart.so.8.0 -&gt; libcudart.so.8.0.44
-rw-r--r-- 1 root root   415432 сен 15 02:02 /usr/local/cuda/lib64/libcudart.so.8.0.44
-rw-r--r-- 1 root root   775162 сен 15 02:02 /usr/local/cuda/lib64/libcudart_static.a
lrwxrwxrwx 1 root root       13 дек 23 02:17 /usr/local/cuda/lib64/libcudnn.so -&gt; libcudnn.so.5
lrwxrwxrwx 1 root root       17 дек 23 02:17 /usr/local/cuda/lib64/libcudnn.so.5 -&gt; libcudnn.so.5.1.5
-rwxr-xr-x 1 root root 79337624 дек 22 04:25 /usr/local/cuda/lib64/libcudnn.so.5.1.5
-rw-r--r-- 1 root root 69756172 дек 22 04:25 /usr/local/cuda/lib64/libcudnn_static.a

</code></pre></div>
<p dir="auto">(yes, it's an unholy mess, with russian date format. sorry)</p>
<p dir="auto">If installed from binary pip package, provide:</p>
<ol dir="auto">
<li>A link to the pip package you installed:<br>
<a href="https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-0.12.0-cp27-none-linux_x86_64.whl" rel="nofollow">https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-0.12.0-cp27-none-linux_x86_64.whl</a><br>
as per<a href="https://www.tensorflow.org/get_started/os_setup" rel="nofollow"> instructions</a></li>
<li>The output from <code class="notranslate">python -c "import tensorflow; print(tensorflow.__version__)"</code>.</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcublas.so locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcudnn.so locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcufft.so locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcurand.so locally
0.12.0"><pre class="notranslate"><code class="notranslate">I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcublas.so locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcudnn.so locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcufft.so locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcurand.so locally
0.12.0
</code></pre></div>
<h3 dir="auto">If possible, provide a minimal reproducible example (We usually don't have time to read hundreds of lines of your code)</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="cd example; 
python /usr/local/lib/python2.7/dist-packages/tensorflow/tensorboard/tensorboard.py --logdir=/home/myname/example/log_simple_graph"><pre class="notranslate"><code class="notranslate">cd example; 
python /usr/local/lib/python2.7/dist-packages/tensorflow/tensorboard/tensorboard.py --logdir=/home/myname/example/log_simple_graph
</code></pre></div>
<h3 dir="auto">What other attempted solutions have you tried?</h3>
<p dir="auto">See above; I've tried to run the actual <code class="notranslate">tensorboard.py</code> instead of just <code class="notranslate">tensorboard --logdir=</code></p>
<h3 dir="auto">Logs or other output that would be helpful</h3>
<p dir="auto">Running <code class="notranslate">cd example;  python /usr/local/lib/python2.7/dist-packages/tensorflow/tensorboard/tensorboard.py --logdir=/home/myname/example/log_simple_graph</code> results in:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcublas.so locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcudnn.so locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcufft.so locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcurand.so locally
Traceback (most recent call last):
  File &quot;/usr/local/lib/python2.7/dist-packages/tensorflow/tensorboard/tensorboard.py&quot;, line 34, in &lt;module&gt;
    from tensorflow.tensorboard.backend import server
  File &quot;/usr/local/lib/python2.7/dist-packages/tensorflow/tensorboard/backend/server.py&quot;, line 37, in &lt;module&gt;
    from tensorflow.tensorboard.backend import handler
  File &quot;/usr/local/lib/python2.7/dist-packages/tensorflow/tensorboard/backend/handler.py&quot;, line 43, in &lt;module&gt;
    from tensorflow.tensorboard.plugins import REGISTERED_PLUGINS
  File &quot;/usr/local/lib/python2.7/dist-packages/tensorflow/tensorboard/plugins/__init__.py&quot;, line 20, in &lt;module&gt;
    from tensorflow.tensorboard.plugins.projector.plugin import ProjectorPlugin
  File &quot;/usr/local/lib/python2.7/dist-packages/tensorflow/tensorboard/plugins/projector/plugin.py&quot;, line 27, in &lt;module&gt;
    from tensorflow.contrib.tensorboard.plugins.projector import PROJECTOR_FILENAME
  File &quot;/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/__init__.py&quot;, line 27, in &lt;module&gt;
    from tensorflow.contrib import factorization
  File &quot;/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/factorization/__init__.py&quot;, line 24, in &lt;module&gt;
    from tensorflow.contrib.factorization.python.ops.gmm import *
  File &quot;/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/factorization/python/ops/gmm.py&quot;, line 30, in &lt;module&gt;
    from tensorflow.contrib.learn.python.learn.estimators import estimator
  File &quot;/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/__init__.py&quot;, line 66, in &lt;module&gt;
    from tensorflow.contrib.learn.python.learn import *
  File &quot;/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/__init__.py&quot;, line 23, in &lt;module&gt;
    from tensorflow.contrib.learn.python.learn import *
  File &quot;/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/__init__.py&quot;, line 27, in &lt;module&gt;
    from tensorflow.contrib.learn.python.learn import estimators
  File &quot;/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/estimators/__init__.py&quot;, line 269, in &lt;module&gt;
    from tensorflow.contrib.learn.python.learn.estimators.classifier import Classifier
  File &quot;/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/estimators/classifier.py&quot;, line 25, in &lt;module&gt;
    from tensorflow.contrib.learn.python.learn.estimators import estimator
  File &quot;/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py&quot;, line 52, in &lt;module&gt;
    from tensorflow.contrib.learn.python.learn.learn_io import data_feeder
  File &quot;/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/learn_io/__init__.py&quot;, line 22, in &lt;module&gt;
    from tensorflow.contrib.learn.python.learn.learn_io.dask_io import extract_dask_data
  File &quot;/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/learn_io/dask_io.py&quot;, line 26, in &lt;module&gt;
    import dask.dataframe as dd
  File &quot;/usr/local/lib/python2.7/dist-packages/dask/dataframe/__init__.py&quot;, line 5, in &lt;module&gt;
    from .io import (from_array, from_pandas, from_bcolz,
  File &quot;/usr/local/lib/python2.7/dist-packages/dask/dataframe/io/__init__.py&quot;, line 6, in &lt;module&gt;
    from .csv import read_csv, to_csv, read_table
  File &quot;/usr/local/lib/python2.7/dist-packages/dask/dataframe/io/csv.py&quot;, line 147, in &lt;module&gt;
    CPU_COUNT = psutil.cpu_count()
AttributeError: 'module' object has no attribute 'cpu_count'
"><pre class="notranslate"><code class="notranslate">I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcublas.so locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcudnn.so locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcufft.so locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:128] successfully opened CUDA library libcurand.so locally
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/tensorboard/tensorboard.py", line 34, in &lt;module&gt;
    from tensorflow.tensorboard.backend import server
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/tensorboard/backend/server.py", line 37, in &lt;module&gt;
    from tensorflow.tensorboard.backend import handler
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/tensorboard/backend/handler.py", line 43, in &lt;module&gt;
    from tensorflow.tensorboard.plugins import REGISTERED_PLUGINS
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/tensorboard/plugins/__init__.py", line 20, in &lt;module&gt;
    from tensorflow.tensorboard.plugins.projector.plugin import ProjectorPlugin
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/tensorboard/plugins/projector/plugin.py", line 27, in &lt;module&gt;
    from tensorflow.contrib.tensorboard.plugins.projector import PROJECTOR_FILENAME
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/__init__.py", line 27, in &lt;module&gt;
    from tensorflow.contrib import factorization
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/factorization/__init__.py", line 24, in &lt;module&gt;
    from tensorflow.contrib.factorization.python.ops.gmm import *
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/factorization/python/ops/gmm.py", line 30, in &lt;module&gt;
    from tensorflow.contrib.learn.python.learn.estimators import estimator
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/__init__.py", line 66, in &lt;module&gt;
    from tensorflow.contrib.learn.python.learn import *
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/__init__.py", line 23, in &lt;module&gt;
    from tensorflow.contrib.learn.python.learn import *
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/__init__.py", line 27, in &lt;module&gt;
    from tensorflow.contrib.learn.python.learn import estimators
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/estimators/__init__.py", line 269, in &lt;module&gt;
    from tensorflow.contrib.learn.python.learn.estimators.classifier import Classifier
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/estimators/classifier.py", line 25, in &lt;module&gt;
    from tensorflow.contrib.learn.python.learn.estimators import estimator
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 52, in &lt;module&gt;
    from tensorflow.contrib.learn.python.learn.learn_io import data_feeder
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/learn_io/__init__.py", line 22, in &lt;module&gt;
    from tensorflow.contrib.learn.python.learn.learn_io.dask_io import extract_dask_data
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/contrib/learn/python/learn/learn_io/dask_io.py", line 26, in &lt;module&gt;
    import dask.dataframe as dd
  File "/usr/local/lib/python2.7/dist-packages/dask/dataframe/__init__.py", line 5, in &lt;module&gt;
    from .io import (from_array, from_pandas, from_bcolz,
  File "/usr/local/lib/python2.7/dist-packages/dask/dataframe/io/__init__.py", line 6, in &lt;module&gt;
    from .csv import read_csv, to_csv, read_table
  File "/usr/local/lib/python2.7/dist-packages/dask/dataframe/io/csv.py", line 147, in &lt;module&gt;
    CPU_COUNT = psutil.cpu_count()
AttributeError: 'module' object has no attribute 'cpu_count'

</code></pre></div>
<p dir="auto">I've been following <a href="https://www.oreilly.com/learning/hello-tensorflow" rel="nofollow">this</a> intro, and the code from there worked perfectly for me (apart from some warnings about deprecations).</p>