簡體   English   中英

如何使用 CUDA 10.0 安裝 tensorflow-gpu 1.12

[英]How to install tensorflow-gpu 1.12 with CUDA 10.0

我知道tensorflow-gpu==1.12需要 CUDA 9.0 或更低版本,但有沒有可能在CUDA 10.0上安裝 Tensorflow? 可能是通過源代碼還是使用Bazel

更新:我嘗試從 Github 下載並通過 Bazel 安裝,但出現以下錯誤。

Python 3.7.1 (default, Oct 23 2018, 19:19:42) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
Traceback (most recent call last):
  File "/some-folder/tensorflow-1.12.0/tensorflow/python/platform/self_check.py", line 25, in <module>
    from tensorflow.python.platform import build_info
ImportError: cannot import name 'build_info' from 'tensorflow.python.platform' (unknown location)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/some-folder/tensorflow-1.12.0/tensorflow/__init__.py", line 24, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: disable=unused-import
  File "/some-folder/tensorflow-1.12.0/tensorflow/python/__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/some-folder/tensorflow-1.12.0/tensorflow/python/pywrap_tensorflow.py", line 25, in <module>
    from tensorflow.python.platform import self_check
  File "/some-folder/tensorflow-1.12.0/tensorflow/python/platform/self_check.py", line 27, in <module>
    raise ImportError("Could not import tensorflow. Do not import tensorflow "
ImportError: Could not import tensorflow. Do not import tensorflow from its source directory; change directory to outside the TensorFlow source tree, and relaunch your Python interpreter from there.

tensorflow 不支持 python 3.7 版本。 需要 Python 3.4、3.5 或 3.6

見下文https://www.tensorflow.org/install/pip

我們只需要從源目錄中出來並運行 python 文件。 如果您使用python filename.py命令運行文件,則需要將文件移到源目錄之外。

當您從源目錄使用import tensorflow ,它將導入文件夾tensorflow而不是實際的 tensorflow 庫

暫無
暫無

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

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