gpt4 book ai didi

python - 导入tensorflow时出现错误 'ImportError: DLL load failed: The specified module could not be found.'

转载 作者:行者123 更新时间:2023-12-02 10:45:55 25 4
gpt4 key购买 nike

我已经看到并实现了解决该问题的几种潜在解决方案,但似乎没有一个可行。
我可以为导入tensorflow的错误获得解决方案吗?
版本
-> python 3.7.4
-> tensorflow 2.3.0

runfile('C:/Users/pshad/.spyder-py3/temp.py', wdir='C:/Users/pshad/.spyder-py3') Traceback (most recent call last):

File "<ipython-input-27-bc8fb4f78acd>", line 1, in <module>
runfile('C:/Users/pshad/.spyder-py3/temp.py', wdir='C:/Users/pshad/.spyder-py3')

File "C:\Users\pshad\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile
execfile(filename, namespace)

File "C:\Users\pshad\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)

File "C:/Users/pshad/.spyder-py3/temp.py", line 9, in <module>
import tensorflow as tf

File "C:\Users\pshad\Anaconda3\lib\site-packages\tensorflow\__init__.py", line 41, in <module>
from tensorflow.python.tools import module_util as _module_util

File "C:\Users\pshad\Anaconda3\lib\site-packages\tensorflow\python\__init__.py", line 40, in <module>
from tensorflow.python.eager import context

File "C:\Users\pshad\Anaconda3\lib\site-packages\tensorflow\python\eager\context.py", line 35, in <module>
from tensorflow.python import pywrap_tfe

File "C:\Users\pshad\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tfe.py", line 28, in <module>
from tensorflow.python import pywrap_tensorflow

File "C:\Users\pshad\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 83, in <module>
raise ImportError(msg)

ImportError: Traceback (most recent call last): File "C:\Users\pshad\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in <module>
from tensorflow.python._pywrap_tensorflow_internal import * ImportError: DLL load failed: The specified module could not be found.


Failed to load the native TensorFlow runtime.

最佳答案

Anaconda为Tensorflow提供了一个安装程序,可以处理所有事情,包括所有GPU和CUDA依赖项:

conda install -c anaconda tensorflow-gpu
它适用于Tensorflow 2.1和Python 3.7。当单独安装组件或通过Anaconda以外的其他 channel 安装组件时,DLL故障很常见。

关于python - 导入tensorflow时出现错误 'ImportError: DLL load failed: The specified module could not be found.',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63279533/

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