最近打算开始研究一下机器学习,今天在windows上装tensorflow花了点功夫,其实前面的步骤不难,只要依次装好python3.5,numpy,tensorflow就行了,有一点要注意的是目前只有python3.5能装tensorflow,最新版的python3.6都不行。
装好tensorflow后,我建议大家不要直接用测试用例进行测试(如果没装好的话出现的错误一般都是:module ‘tensorflow' has no attribute ‘constant')。第一次测试时可以在python shell里面输入:
import tensorflow
如果没有报错,恭喜你,十有八九是装好了,这时可以再用简单的测试用例测试一下。但我估计没报错的话你也不会看到这篇博客了。。。
事实上,我第一次安装的时候出现了如下错误:
Traceback (most recent call last):
File “D:\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py”, line 18, in swig_import_helper
return importlib.import_module(mname)
File “D:\Python\Python35\lib\importlib__init__.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “frozen importlib._bootstrap”, line 986, in _gcd_import
File “frozen importlib._bootstrap”, line 969, in _find_and_load
File “frozen importlib._bootstrap”, line 958, in _find_and_load_unlocked
File “frozen importlib._bootstrap”, line 666, in _load_unlocked
File “frozen importlib._bootstrap”, line 577, in module_from_spec
File “frozen importlib._bootstrap_external”, line 906, in create_module
File “frozen importlib._bootstrap”, line 222, in _call_with_frames_removed
ImportError: DLL load failed: 找不到指定的模块。
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “D:\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow.py”, line 41, in module
from tensorflow.python.pywrap_tensorflow_internal import *
File “D:\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py”, line 21, in module
_pywrap_tensorflow_internal = swig_import_helper()
File “D:\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py”, line 20, in swig_import_helper
return importlib.import_module(‘_pywrap_tensorflow_internal')
File “D:\Python\Python35\lib\importlib__init__.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: No module named ‘_pywrap_tensorflow_internal'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “pyshell#0”, line 1, in module
import tensorflow
File “D:\Python\Python35\lib\site-packages\tensorflow__init__.py”, line 24, in module
from tensorflow.python import *
File “D:\Python\Python35\lib\site-packages\tensorflow\python__init__.py”, line 51, in module
from tensorflow.python import pywrap_tensorflow
File “D:\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow.py”, line 52, in module
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File “D:\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py”, line 18, in swig_import_helper
return importlib.import_module(mname)
File “D:\Python\Python35\lib\importlib__init__.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “frozen importlib._bootstrap”, line 986, in _gcd_import
File “frozen importlib._bootstrap”, line 969, in _find_and_load
File “frozen importlib._bootstrap”, line 958, in _find_and_load_unlocked
File “frozen importlib._bootstrap”, line 666, in _load_unlocked
File “frozen importlib._bootstrap”, line 577, in module_from_spec
File “frozen importlib._bootstrap_external”, line 906, in create_module
File “frozen importlib._bootstrap”, line 222, in _call_with_frames_removed
ImportError: DLL load failed: 找不到指定的模块。
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “D:\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow.py”, line 41, in module
from tensorflow.python.pywrap_tensorflow_internal import *
File “D:\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py”, line 21, in module
_pywrap_tensorflow_internal = swig_import_helper()
File “D:\Python\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py”, line 20, in swig_import_helper
return importlib.import_module(‘_pywrap_tensorflow_internal')
File “D:\Python\Python35\lib\importlib__init__.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: No module named ‘_pywrap_tensorflow_internal'
Failed to load the native TensorFlow runtime.
Seehttps://www.tensorflow.org/install/install_sources
for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.
之前在网上查安装方法时,大多数都说要装一个Anaconda,但我是直接装的python3.5,所以没装Anaconda,我相信问题不在这里。后来看到有人说装了visual studio2017解决了这个错误,我想不至于吧,装个tensorflow还要装个visual studio2017?事实上只是visual studio2017中刚好有运行tensorflow必须的运行时环境。所以,只要安装一下缺少的运行时环境就可以了,可以在如下网站中按照它的install instructions进行安装,非常简单,只要注意选对32位和64位的版本就行了。
https://www.microsoft.com/en-us/download/details.aspx"color: #ff0000">总结
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。
更新日志
- 伍佰.2002-冬之火九重天演唱会特选录音专辑2CD【滚石】【WAV+CUE】
- 李宗盛1996《李宗盛的凡人歌2CD》滚石[WAV+CUE][1G]
- 刘德华 《天意》1:1直刻黑胶LPCD[WAV+CUE][1.1G]
- 刘德丽2024《赤的疑惑HQCD》头版限量编号MQA[低速原抓WAV+CUE]
- 英雄联盟万圣节有什么皮肤返场 2024万圣节皮肤返场一览
- lol万圣节赠礼活动什么时候开始 2024万圣节活动时间介绍
- 2024全球总决赛blg是全华班吗 全球总决赛blg选手所属国家介绍
- 《LOL》S14半决赛:T1战胜GEN晋级决赛!对决BLG
- 《完蛋美女前传》白白演员抱怨:都没人玩我的线
- 玩家热议OLED屏对画面提升巨大:比PS5 Pro值得买
- PatriciaPaay-TheLadyIsAChamp(ExpandedEdition)(2024)[24Bit-96kHz]FLAC
- 尚士达.2024-莫回头【智慧小狗】【DTS-WAV分轨】
- 区瑞强-黄金时代HQCDII头版限量wav
- 孙露《终于等到你》[WAV分轨][488M]
- 张信哲《歌时代》 潮水音乐 [WAV+CUE]