【问题标题】:Python 3.6 throws error while trying to import TensorflowPython 3.6 在尝试导入 Tensorflow 时抛出错误
【发布时间】:2019-09-29 06:53:28
【问题描述】:

每当我尝试在我的 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

【问题讨论】:

  • 你见过this github issue吗? (我用谷歌搜索“从 google.protobuf.pyext import _message ImportError: DLL load failed: The specified procedure could not be found”)

标签: python tensorflow machine-learning pip


【解决方案1】:

我在单独的环境中在 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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-06-30
    • 2018-04-14
    • 2018-12-07
    • 2021-12-09
    • 2017-07-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多