ImportError: cannot import name pywrap_tensorflow

2,737 views
Skip to first unread message

pswpe...@gmail.com

unread,
Dec 15, 2016, 2:47:24 PM12/15/16
to Discuss
Note:
1)This is not my tensorflow folder
2)This is really weird

System environment:

Information of cluster:
Basically our cluster is made of IBM Power System S822LC for commercial computing
  • OS: Red Hat Enterprise Linux Server release 7.2 (Maipo)
  • TF version: 0.10.0rc0
  • protobuf: 3.0.0b2
  • Python: 2.7.5
Problem description
>>> import os
>>> cwd = os.getcwd()

>>> cwd
'/gpfs/gpfs0/groups/duraisamy/shawnpan/test/script'

>>> import tensorflow

import tensorflow
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcublas.so.8.0 locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcudnn.so.5.1.5 locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcufft.so.8.0 locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:108] successfully opened CUDA library libcurand.so.8.0 locally
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/gpfs/gpfs0/software/rhel72/packages/tensorflow_gpu/tensorflow/__init__.py", line 23, in <module>
    from tensorflow.python import *
  File "/gpfs/gpfs0/software/rhel72/packages/tensorflow_gpu/tensorflow/python/__init__.py", line 58, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "/gpfs/gpfs0/software/rhel72/packages/tensorflow_gpu/tensorflow/python/__init__.py", line 52, in <module>
    from tensorflow.core.framework.graph_pb2 import *
  File "/gpfs/gpfs0/software/rhel72/packages/tensorflow_gpu/tensorflow/core/framework/graph_pb2.py", line 6, in <module>
    from google.protobuf import descriptor as _descriptor
ImportError: No module named google.protobuf


Error importing tensorflow.  Unless you are using bazel,
you should not try to import tensorflow from its source directory;
please exit the tensorflow source tree, and relaunch your python interpreter
from there.

Martin Wicke

unread,
Dec 15, 2016, 6:13:51 PM12/15/16
to Pab Peter, Discuss
This (in your case decidedly misleading) error message happens whenever some part of tensorflow fails to import properly.

This particular error is a problem in the protobuf package, that you probably hit more than most because you have lots of other packages installed: https://github.com/google/protobuf/issues/1296

There's a workaround in that thread, but it's ugly.


--
You received this message because you are subscribed to the Google Groups "Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss+unsubscribe@tensorflow.org.
To post to this group, send email to dis...@tensorflow.org.
To view this discussion on the web visit https://groups.google.com/a/tensorflow.org/d/msgid/discuss/810cadd4-4d0f-4c9a-b94f-873d0fcde12f%40tensorflow.org.

pswpe...@gmail.com

unread,
Jan 5, 2017, 12:08:44 PM1/5/17
to Discuss, pswpe...@gmail.com
problem resolved. it turns out to be googleprobuf corrupted on some nodes.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss+u...@tensorflow.org.
Reply all
Reply to author
Forward
0 new messages