簡體   English   中英

從源構建后Tensorflow導入錯誤

[英]Tensorflow import error after building from source

我從該版本的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。有人知道這是什么問題嗎?

如果有人感興趣,我在這里找到了解決方案https://github.com/tensorflow/tensorflow/issues/6341

但基本上它只是

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM