CentOS7+ anaconda3 + Python-3.6 + tensorflow-cpu-1.5安装和配置
CentOS7+ anaconda3 + Python-3.6 + tensorflow-cpu-1.5安装和配置
=============================================================================
本博客,博文:CentOS7服务器上部署深度/机器学习环境推荐首选anaconda3 链接https://www.cnblogs.com/jeshy/p/10522379.html
可能会出错:
>>> import tensorflow as tf
Illegal instruction
本文主要解决此问题(降低版本)
=============================================================================
(base) [jiangshan@localhost ~]$ conda info -e
# conda environments:
#
base * /home/jiangshan/anaconda3
tensorflow /home/jiangshan/anaconda3/envs/tensorflow
==========先卸载和删除掉先前创建 的tensorflow虚拟环境=======================
(base) [jiangshan@localhost ~]$ conda remove --name tensorflow --all
==========先卸载和删除掉先前创建 的tensorflow虚拟环境=======================
(base) [jiangshan@localhost ~]$ conda info -e
# conda environments:
#
base * /home/jiangshan/anaconda3
(base) [jiangshan@localhost ~]$ conda create --name tensorflow python=3.6
(base) [jiangshan@localhost ~]$ conda activate tensorflow
添加设置镜像
# 添加tensorflow的Linux/cpu清华镜像
(tensorflow) [jiangshan@localhost ~]$ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/tensorflow/linux/cpu/
# 设置搜索时显示通道地址
(tensorflow) [jiangshan@localhost ~]$ conda config --set show_channel_urls yes
**************************************************************************
安装 tensorflow1.8.0
(tensorflow) [jiangshan@localhost ~]$ conda install tensorflow==1.8
以上会出错,改为以下用pip从源码安装
(tensorflow) [jiangshan@localhost ~]$ pip install tensorflow==1.8
测试==报错==
Python 3.6.7 | packaged by conda-forge | (default, Feb 28 2019, 09:07:38)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
Illegal instruction
补救 卸载 tensorflow1.8 改安装较低版本的tensorflow(我来来回回降到了1.5版)
(tensorflow) [jiangshan@localhost ~]$ pip uninstall tensorflow
**************************************************************************
安装 tensorflow1.5
(tensorflow) [jiangshan@localhost ~]$ pip install tensorflow==1.5
测试
(tensorflow) [jiangshan@localhost ~]$ python
Python 3.6.7 | packaged by conda-forge | (default, Feb 28 2019, 09:07:38)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
>>> hello = tf.constant('你好!姜山~')
>>> sess = tf.Session()
2019-03-13 03:39:49.959697: I tensorflow/core/platform/cpu_feature_guard.cc:137] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2
>>> print (sess.run(hello))
b'\xe4\xbd\xa0\xe5\xa5\xbd\xef\xbc\x81\xe5\xa7\x9c\xe5\xb1\xb1~'【我靠 不识别中文?????,赶紧换英文试试】
>>> hello = tf.constant('hhhh')
>>> sess = tf.Session()
>>> print (sess.run(hello))
b'hhhh'
>>> quit()
(tensorflow) [jiangshan@localhost ~]$ conda deactivate
(base) [jiangshan@localhost ~]$
成功
CentOS7+ anaconda3 + Python-3.6 + tensorflow-cpu-1.5安装和配置的更多相关文章
- Python黑帽编程1.1虚拟机安装和配置 Kali Linux 2016
Python黑帽编程1.1虚拟机安装和配置 Kali Linux 2016 0.1 本系列教程说明 本系列教程,采用的大纲母本为<Understanding Network Hacks Att ...
- Nginx+Python+uwsgi+Django的web开发环境安装及配置
Nginx+Python+uwsgi+Django的web开发环境安装及配置 nginx安装 nginx的安装这里就略过了... python安装 通常系统已经自带了,这里也略过 uwsgi安装 官网 ...
- Windows中Anaconda,Tensorflow 和 Pycharm的安装和配置
Anaconda完全入门指南 https://www.jianshu.com/p/eaee1fadc1e9 [安装不要按此条链接进行] Windows中 Anacond ...
- Python入门:Anaconda和Pycharm的安装和配置
Python入门:Anaconda和Pycharm的安装和配置 转自:https://www.cnblogs.com/yuxuefeng/articles/9235431.html 子曰:“工欲善其 ...
- mysql 5.7.29 在centos7.6下超简单的本地yum源安装与配置
目录 生成yum源元数据 从网易镜像站下载MySQL 5.7 的 bundle包 创建文件 mysql-local.repo 执行yum install命令 生成yum源元数据 createrepo ...
- 【转】Python入门:Anaconda和Pycharm的安装和配置
子曰:“工欲善其事,必先利其器.”学习Python就需要有编译Python程序的软件,一般情况下,我们选择在Python官网下载对应版本的Python然后用记事本编写,再在终端进行编译运行即可,但是对 ...
- Anaconda多版本Python管理以及TensorFlow版本的选择安装
Anaconda是一个集成python及包管理的软件,记得最早使用时在2014年,那时候网上还没有什么资料,需要同时使用py2和py3的时候,当时的做法是同时安装Anaconda2和Anaconda3 ...
- python在windows和linux下的安装和配置
一.windows下安装python3.6 安装编辑器:Ecplise+pydev插件 Eclipse是写JAVA的IDE, 这样就可以通用了,学习代价小. 学会了Eclipse, 以后写Pytho ...
- 【Python①】python简介,安装以及配置
今天开始学习python,将一些心得和知识点记录下来,如有疏漏或表达问题,欢迎指正.后面所有代码均为Python 3.3.2版本(运行环境:Windows7)编写. 附:2014年8月TIOBE编程语 ...
- centos7 源码编译安装TensorFlow CPU 版本
一.前言 我们都知道,普通使用pip安装的TensorFlow是万金油版本,当你运行的时候,会提示你不是当前电脑中最优的版本,特别是CPU版本,没有使用指令集优化会让TensorFlow用起来更慢. ...
随机推荐
- linux系统编程:open常用参数详解
open用于打开一个文件,通过设置不同的flag,可以让进程只读,只写,可读/可写等操作 一.对一个不存在或者存在的文件(test.txt),进行写入操作 /*==================== ...
- 2016计蒜之道复赛 百度地图的实时路况(Floyd 分治)
题意 题目链接 Sol 首先一个结论:floyd算法的正确性与最外层\(k\)的顺序无关(只要保证是排列即可) 我大概想到一种证明方式就是把最短路树上的链拿出来,不论怎样枚举都会合并其中的两段,所以正 ...
- Android Dragger2快速入门浅析
定Dagger2的基本介绍:dagger2是一个依赖注入框架,在编译期间自动生成代码,负责依赖对象的创建. 使用Dagger2的好处:为了进一步解耦和方便测试,我们会使用依赖注入的方式构建对象 (不使 ...
- Expo大作战(十四)--expo中消息推送的实现
简要:本系列文章讲会对expo进行全面的介绍,本人从2017年6月份接触expo以来,对expo的研究断断续续,一路走来将近10个月,废话不多说,接下来你看到内容,讲全部来与官网 我猜去全部机翻+个人 ...
- idea总是编译启动报错
使用多环境配置时候,总是会出现莫名其妙的启动报错.主要是没有多环境配置的参数,挺奇怪的,因为这个问题时现时不现.又没有什么具体规律,一直找不到原因.今天一个偶然的机会,发现会不会是这个原因?
- Git 命令快速浏览
Git 命令快速浏览 创建 Git 可管理的仓库 git init 查看当前仓库的状态 git status 添加到仓库,实际上是添加到暂存区 git add [-A | --all] git add ...
- Linux网络配置和网络诊断命令介绍
方法/步骤 1 在接下来的讲解中,讲解的Linux网络配置和网络诊断的命令有: ifconfig.ping.netstat.traceroute.dig和nslookup.host.hostname. ...
- 万恶的浏览器缓存 Vuex state里面的成员改名后浏览器不会马上更新
今天在用Vuex的时候,在state里面加了个名叫rootUrl的属性 但是怎么都取不到值,重新启动程序,ctrl+f5浏览器刷新都不行,纠结了大半上午,于是用console.log(store.ge ...
- Relinking Oracle Home FAQ ( Frequently Asked Questions) (Doc ID 1467060.1)
In this Document Purpose Questions and Answers 1) What is relinking ? 2) What is relinking ...
- SQL Server 复制表结构、整表数据
1.将表1结构复制到表2 SELECT * INTO 表2 FROM 表1 WHERE 1=2 2.将表1内容全部复制到表2 SELECT * INTO 表2 FROM 表1