Tensorflow安装错误与解决

Tensorflow安装错误与解决

centos安装tensorflow我们经常会用如下的代码进行安装:
pip install -i https://pypi.douban.com/simple tensorflow
经过漫长的等待,我们发现提示也安装成功了!于是按捺不住我们激动的小心脏去使用下:

Python 3.6.5 |Anaconda, Inc.| (default, Apr 29 2018, 16:14:56) 
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
非法指令(吐核)

what??? 这个东东貌似是操作系统的错误!!!网上找了好半天才发现:
哈哈哈,没错就是因为你的机器太老了!!而tensorflow这个版本太新了,和你的机器不兼容导致的,装一个旧版本就好了!!
pip install -i https://pypi.douban.com/simple tensorflow==1.5.0
现在再试下就好了:

Python 3.6.5 |Anaconda, Inc.| (default, Apr 29 2018, 16:14:56) 
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> 

你可能感兴趣的:(机器学习)