gpt4 book ai didi

Python 3.6 在尝试导入 Tensorflow 时抛出错误

转载 作者:行者123 更新时间:2023-11-30 09:43:21 24 4
gpt4 key购买 nike

每当我尝试在 Windows PC 上导入 TensorFlow 时,Python 总是在控制台上抛出此错误

import tensorflow

    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

关于Python 3.6 在尝试导入 Tensorflow 时抛出错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56093255/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com