无法导入张量流

时间:2020-09-06 17:33:31

标签: python-3.x tensorflow importerror

File "C:\Users\deepz\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in <module>            
    from tensorflow.python._pywrap_tensorflow_internal import *
    

ImportError: DLL load failed while importing _pywrap_tensorflow_internal: The specified module could not be found.

                        

During handling of the above exception, another exception occurred:                       
    
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\deepz\anaconda3\lib\site-packages\tensorflow\__init__.py", line 41, in <module>                            
                                    from tensorflow.python.tools import module_util as _module_util
File "C:\Users\deepz\anaconda3\lib\site-packages\tensorflow\python\__init__.py", line 40, in <module>                     
        from tensorflow.python.eager import context
File "C:\Users\deepz\anaconda3\lib\site-packages\tensorflow\python\eager\context.py", line 35, in <module>                
        from tensorflow.python import pywrap_tfe
File "C:\Users\deepz\anaconda3\lib\site-packages\tensorflow\python\pywrap_tfe.py", line 28, in <module>                   
        from tensorflow.python import pywrap_tensorflow
File "C:\Users\deepz\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\deepz\anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 64, in <module>            
    from tensorflow.python._pywrap_tensorflow_internal import *
ImportError: DLL load failed while importing _pywrap_tensorflow_internal: The specified module could not be found.



Failed to load the native TensorFlow runtime.


See https://www.tensorflow.org/install/errors

importing TensorFlow as tf上 我收到此错误,请有人可以帮助我解决此问题。 系统HP 245 G5和操作系统Windows 10 2004版

1 个答案:

答案 0 :(得分:2)

如果您安装了Anaconda,我建议您使用Conda将tensorflow安装到新环境中。原因是Conda安装了tensorflow和所需的Cuda工具包以及cuDNN的正确版本。 Pip不会安装这些文件,您必须单独下载它们,解压缩并将它们存储在目录中。您还必须调整环境变量以指向这些目录。