圆月山庄资源网 Design By www.vgjia.com

在安装tensorflow完成后,import tensorflow as tf出现问题,问题如下:

> import tensorflow as tf
Traceback (most recent call last):
 File "I:\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
  from tensorflow.python.pywrap_tensorflow_internal import *
 File "I:\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
  _pywrap_tensorflow_internal = swig_import_helper()
 File "I:\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
  _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
 File "I:\Anaconda3\lib\imp.py", line 242, in load_module
  return load_dynamic(name, filename, file)
 File "I:\Anaconda3\lib\imp.py", line 342, in load_dynamic
  return _load(spec)
ImportError: DLL load failed: 动态链接库(DLL)初始化例程失败。
 
During handling of the above exception, another exception occurred:
 
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "I:\Anaconda3\lib\site-packages\tensorflow\__init__.py", line 24, in <module>
  from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
 File "I:\Anaconda3\lib\site-packages\tensorflow\python\__init__.py", line 49, in <module>
  from tensorflow.python import pywrap_tensorflow
 File "I:\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 74, in <module>
  raise ImportError(msg)
ImportError: Traceback (most recent call last):
 File "I:\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line 58, in <module>
  from tensorflow.python.pywrap_tensorflow_internal import *
 File "I:\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 28, in <module>
  _pywrap_tensorflow_internal = swig_import_helper()
 File "I:\Anaconda3\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line 24, in swig_import_helper
  _mod = imp.load_module('_pywrap_tensorflow_internal', fp, pathname, description)
 File "I:\Anaconda3\lib\imp.py", line 242, in load_module
  return load_dynamic(name, filename, file)
 File "I:\Anaconda3\lib\imp.py", line 342, in load_dynamic
  return _load(spec)
ImportError: DLL load failed: 动态链接库(DLL)初始化例程失败。
 
 
Failed to load the native TensorFlow runtime.
 
See https://www.tensorflow.org/install/errors
 
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.

问题原因:

tensorflow的新版本不支持比较老的cpu(我这个老机器表示很桑心)

解决办法:

卸载现有的tensorflow,安装tensorflow1.5版本

依次执行:

pip uninstall tensorflow

pip install tensorflow==1.5 -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com

成功

另外其他原因:

报错:
import tensorflow遇到以下报错:

tensorflow安装成功import tensorflow 出现问题

原因分析:
根据报错信息,导入(import)失败的原因是在源目录中导入(import)。

解决办法:
使用cd ..命令回到上一级目录,重新导入(import),导入(import)成功

补充:
在github中也有类似问题-可能不是同一原因导致-的讨论,针对的是“Failed to load the native TensorFlow runtime.“的问题,链接如下。
github该问题讨论

标签:
tensorflow,import,出现问题,import,tensorflow,失败

圆月山庄资源网 Design By www.vgjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
圆月山庄资源网 Design By www.vgjia.com

RTX 5090要首发 性能要翻倍!三星展示GDDR7显存

三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。

首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。

据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。