ImportError: No module named 'tensorflow.python' Mac GPU #7193

Closed
UkiDLucas opened this Issue Feb 1, 2017 · 2 comments

Projects

None yet

3 participants

@UkiDLucas
UkiDLucas commented Feb 1, 2017 edited

Running 2 Jupyter kernels reflecting conda envs:

  • tensorflow CPU
  • tensorflow GPU
    Both are configured with 0.12.1 for Mac.

CPU VERSION (tensorflow 0.12.1) works well as expected:

import tensorflow as tf
print("OUT: tensorflow imported")

OUT: tensorflow imported

from tensorflow.python.client import device_lib
def get_available_CPU_GPU():
    devices = device_lib.list_local_devices()
    #return [x.name for x in devices if x.device_type == 'CPU']
    return [x.name for x in devices ]
print(get_available_CPU_GPU())

['/cpu:0'] - as expected only CPU shows

SAME CODE GPU VERSION (tensorflow-gpu 0.12.1 ):

OUT: tensorflow imported

So it sees the TensorFlow correctly, but then only a part of it.

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
 in ()
----> 1 **from tensorflow.python.client import device_lib**
      2 
      3 def get_available_CPU_GPU():
      4     devices = device_lib.list_local_devices()
      5     #return [x.name for x in devices if x.device_type == 'CPU']

ImportError: No module named 'tensorflow.python'
features = tf.placeholder(tf.float32, (None, 32, 32, 3))
AttributeError: module 'tensorflow' has no attribute 'placeholder'
@gunan
Member
gunan commented Feb 1, 2017

I cannot reproduce the exact problem on my mac-gpu machine.
Could you try reinstalling, maybe it is a problem with some files being copied during installation?

@gunan
Member
gunan commented Feb 13, 2017

@UkiDLucas is it possible uu installed using conda install?
That is not an officially supported way to install. I recommend you retry installing with pip install even after using conda to create the environment.

As I also cannot reproduce the problem, can did not receive a response for 10 days now, I am closing this issue.

@gunan gunan closed this Feb 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment