从源构建后Tensorflow导入错误

时间:2019-01-31 04:32:05

标签: python tensorflow

我从此版本https://github.com/tensorflow/tensorflow/releases/tag/v1.13.0-rc0的源代码构建了带有GPU支持的tensorflow,一切正常,但是当我在python中导入tensorflow时,我得到了错误

>>> import tensorflow
ImportError: No module named _multiarray_umath
ImportError: No module named _multiarray_umath
ImportError: numpy.core._multiarray_umath failed to import
ImportError: numpy.core.umath failed to import
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "tensorflow/__init__.py", line 24, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "tensorflow/python/__init__.py", line 52, in <module>
    from tensorflow.core.framework.graph_pb2 import *
  File "tensorflow/core/framework/graph_pb2.py", line 6, in <module>
    from google.protobuf import descriptor as _descriptor
ImportError: No module named protobuf

我确实安装了protobuf。另外,我在CUDA 10上使用ubuntu 16.04。有人知道这是什么问题吗?

1 个答案:

答案 0 :(得分:0)

如果有人感兴趣,我在https://github.com/tensorflow/tensorflow/issues/6341

处找到了解决方案

但基本上是公正的

pip uninstall protobuf
pip uninstall google
pip install google
pip install protobuf