簡體   English   中英

嘗試導入Tensorflow時Python 3.6引發錯誤

[英]Python 3.6 throws error while trying to import Tensorflow

每當我嘗試在Windows PC上導入tensorflow時,python總是在控制台上拋出此錯誤

導入張量流

    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File 
    "C:\Users\AyushSingh\AppData\Local\Programs\Python\Python36\lib\site- 
    packages\tensorflow\__init__.py", line 24, in <module>
    from tensorflow.python import pywrap_tensorflow  # pylint: 
    disable=unused-import
    File
    "C:\Users\Ayush Singh\AppData\Local\Programs\Python\Python36\lib\site- 
    packages\tensorflow\python\__init__.py", line 52, in <module>
    from tensorflow.core.framework.graph_pb2 import *
    File 
    "C:\Users\Ayush Singh\AppData\Local\Programs\Python\Python36\lib\site- 
    packages\tensorflow\core\framework\graph_pb2.py", line 6, in <module>
    from google.protobuf import descriptor as _descriptor
    File 
    "C:\Users\Ayush Singh\AppData\Local\Programs\Python\Python36\lib\site- 
    packages\google\protobuf\descriptor.py", line 47, in <module>
    from google.protobuf.pyext import _message
    ImportError: DLL load failed: The specified procedure could not be 
    found.

我已經嘗試使用pip3卸載並重新安裝tensorflow

我在另一個環境中在Windows下設置tensorflow時發布日志。 也許這對您有幫助:

conda create --name tfpy3p6 python=3.6 -y

conda activate tfpy3p6

conda install -c anaconda cudatoolkit==9.0
conda install -c anaconda cudnn

pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_gpu-1.12.0-cp36-cp36m-win_amd64.whl

conda install ipython
conda install notebook==5.7.5
ipython kernel install --user

暫無
暫無

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

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