python - 导入 tensorflow 模块时出错
问题描述
当我使用命令 import tensorflow as tf 时,出现以下错误:
Traceback (most recent call last):
File "C:\Users\rodri647\AppData\Local\Continuum\anaconda2\envs\chemvae\lib\sit
e-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 14, in swig_im
port_helper
return importlib.import_module(mname)
File "C:\Users\rodri647\AppData\Local\Continuum\anaconda2\envs\chemvae\lib\imp
ortlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 658, in _load_unlocked
File "<frozen importlib._bootstrap>", line 571, in module_from_spec
File "<frozen importlib._bootstrap_external>", line 922, in create_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: DLL load failed with error code -1073741795
...
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\rodri647\AppData\Local\Continuum\anaconda2\envs\chemvae\lib\sit
e-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "C:\Users\rodri647\AppData\Local\Continuum\anaconda2\envs\chemvae\lib\sit
e-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 17, in <module
>
_pywrap_tensorflow_internal = swig_import_helper()
File "C:\Users\rodri647\AppData\Local\Continuum\anaconda2\envs\chemvae\lib\sit
e-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 16, in swig_im
port_helper
return importlib.import_module('_pywrap_tensorflow_internal')
File "C:\Users\rodri647\AppData\Local\Continuum\anaconda2\envs\chemvae\lib\imp
ortlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named '_pywrap_tensorflow_internal'
Failed to load the native TensorFlow runtime.
See https://www.tensorflow.org/install/install_sources#common_installation_probl
ems
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
>>>
我在 python 3.5 上使用 tensorflow gpu 1.1.0。我要编译的代码在这里: https ://github.com/aspuru-guzik-group/chemical_vae
解决方案
好像MSVCP140.DLL
您的系统中没有安装。您可以尝试安装Visual C++ Redistributable,卸载然后再次安装 TF。
推荐阅读
- linux - 在 redhat linux 7 上安装 libgpgme 开发包
- selenium - 复选框没有被选中,尽管它在运行测试用例时没有显示错误。有人可以给出建议以获得解决方案
- android - 如果我使用 Moshi,为什么任务 ':app:kaptDebugKotlin' 执行失败?
- scala - Scala3/Dotty 显式空值 Scala2 互操作
- python - 更改 python bultin 函数的默认参数的值
- elasticsearch - ES 索引映射有“查询”参数
- string - 如何通过括号将字符串拆分为子字符串,但也可以将其包含在其他字符串中?
- csv - 构建一个 tf.data.Dataset 对象,其中图像作为特征,.csv 文件作为标签
- artificial-intelligence - 关于知识表示练习的问题
- python - 在熊猫数据框中按组计算计数特征