之前安装过 tensorflow 0.6,还没来得及玩就休假了。回来之后,tensorflow就已经是0.8了,支持分布式训练。于是着手先升级。系统里面之前装caffe,也装过很多tensorflow需要的库,所以一开始安装,各种需求 冲突还是有点头大。


tensorflow有四种安装方式,之前直接用的pip install的方式进行安装。
Pip Install: Install TensorFlow on your machine,possibly upgrading prevIoUsly installedPython packages. May impact existing Python programs on your machine.
Virtualenv Install: Install TensorFlow in its own directory,not impacting any existingPython programs on your machine.
Anaconda install: Install TensorFlow in its own environment for those running the Anaconda Python distribution. Doesnot impact existing Python programs on your machine.
Docker Install: Run TensorFlow in a Docker container isolated from all other programson your machine.


安装方法 : https://www.tensorflow.org/versions/r0.8/get_started/os_setup.html#overview
pip install升级到0.8后,发现运行程序很多问题,首先是glib 和 gcc版本过低的问题。 Centos 系统自带的glibc是2.12。按提示升级到2.15,发现还是不行,继续升级到2.17.
#LD_PRELOAD=/usr/lib64/libc-2.17.so rm /lib64/libc.so.6
#LD_PRELOAD=/lib64/libc-2.17.so ln -s /lib64/libc-2.17.so /lib64/libc.so.6
#strings /usr/lib64/libc.so.6|grep GLIBC
......
GLIBC_2.16
GLIBC_2.17
GLIBC_PRIVATE


然后升级gcc,这个过程需要比较小心,如果失败了,那么很多指令都不能使用了。升级后
#ln /usr/lib64/libstdc++.so.6.0.21 /usr/lib64/libstdc++.so.6
#strings /usr/local/lib64/libstdc++.so.6|grep GLIBCXX
......
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_3.4.20
GLIBCXX_3.4.21
GLIBCXX_FORCE_NEW


然后是安装的protobuf无法识别 :ImportError: No module named protobuf
protobuf安装是成功的,python模块安装出现问题。重装也于事无补,然后选择了virtualenv install的方法,瞬间解决所有问题。
#virtualenv --system-site-packages ~/tensorflow
#source ~/tensorflow/bin/activate


# pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0-cp27-none-linux_x86_64.whl


Collecting tensorflow==0.8.0 from https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0-cp27-none-linux_x86_64.whl
/root/tensorflow/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318:
SNIMissingWarning: An HTTPS request has been made,but the SNI (Subject Name Indication) extension to TLS is not
available on this platform. This may cause the server to present an incorrect TLS certificate,which an cause

validation failures. You can upgrade to a newer version of Python to solve this. For more information,see
https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.
SNIMissingWarning
/root/tensorflow/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122:
InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL

appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve

this. For more information,see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.

InsecurePlatformWarning Using cached https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.8.0-cp27-none-linux_x86_64.whl Collecting numpy>=1.8.2 (from tensorflow==0.8.0) /root/tensorflow/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information,see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. InsecurePlatformWarning Using cached numpy-1.11.0-cp27-cp27mu-manylinux1_x86_64.whl Collecting six>=1.10.0 (from tensorflow==0.8.0) Downloading six-1.10.0-py2.py3-none-any.whl Collecting protobuf==3.0.0b2 (from tensorflow==0.8.0) Using cached protobuf-3.0.0b2-py2.py3-none-any.whl Collecting wheel (from tensorflow==0.8.0) Using cached wheel-0.29.0-py2.py3-none-any.whl Collecting setuptools (from protobuf==3.0.0b2->tensorflow==0.8.0) Using cached setuptools-23.0.0-py2.py3-none-any.whl Installing collected packages: numpy,six,setuptools,protobuf,wheel,tensorflow Successfully installed numpy-1.11.0 protobuf-3.0.0a2 setuptools-23.0.0 six-1.10.0 tensorflow-0.8.0 wheel-0.29.0 python -c 'import os; import inspect; import tensorflow; print(os.path.dirname(inspect.getfile(tensorflow)))' /root/tensorflow/lib/python2.7/site-packages/tensorflow 安装完后,先用命令行测试一下 $ python ... >>> import tensorflow as tf >>> hello = tf.constant('Hello,TensorFlow!') >>> sess = tf.Session() >>> print(sess.run(hello)) Hello,TensorFlow! >>> a = tf.constant(10) >>> b = tf.constant(32) >>> print(sess.run(a + b)) 42 >>> 然后再跑一个实例model #cd /root/tensorflow/lib/python2.7/site-packages/tensorflow/models/image/mnist #python convolutional.py Extracting data/train-images-idx3-ubyte.gz Extracting data/train-labels-idx1-ubyte.gz Extracting data/t10k-images-idx3-ubyte.gz Extracting data/t10k-labels-idx1-ubyte.gz Initialized! Step 0 (epoch 0.00),2.9 ms Minibatch loss: 12.054,learning rate: 0.010000 Minibatch error: 90.6% Validation error: 84.6% ...... #deactivate

Tensorflow在centos上安装记录的更多相关文章

  1. 如何在Android平台上使用Tensorflow?

    谷歌为开发者提供了TENSORFLOW开源软件.有什么方法可以在Android上使用它吗?

  2. 直接在Android NDK端使用tensorflow(不使用JAVA api)

    如何在Android上使用Capis构建和链接tensorflow库.你能指导我吗?

  3. 是否有可能在Android上训练tensorflow?

    似乎没有CAPI来训练张量流图并保存到pb.so,在Android平台上有什么办法吗?我可以在Android设备上使用pythonAPI构建tensorflow工作区吗?

  4. CentOS 8.2服务器上安装最新版Node.js的方法

    这篇文章主要介绍了CentOS 8.2服务器上安装最新版Node.js的方法,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下

  5. python深度学习tensorflow1.0参数和特征提取

    这篇文章主要为大家介绍了python深度学习tensorflow1.0参数和特征提取,有需要的朋友可以借鉴参考下,希望能够有所帮助,祝大家多多进步,早日升职加薪

  6. python人工智能tensorflow函数tf.get_variable使用方法

    这篇文章主要为大家介绍了python人工智能tensorflow函数tf.get_variable使用方法示例,有需要的朋友可以借鉴参考下,希望能够有所帮助,祝大家多多进步,早日升职加薪

  7. centos+php+coreseek+sphinx+mysql之一coreseek安装篇

    这篇文章主要介绍了centos+php+coreseek+sphinx+mysql之一coreseek安装篇的相关资料,非常不错具有参考借鉴价值,需要的朋友可以参考下

  8. python人工智能tensorflow优化器Optimizer算法汇总

    这篇文章主要为大家介绍了python人工智能tensorflowtf优化器Optimizer算法汇总,有需要的朋友可以借鉴参考下,希望能够有所帮助,祝大家多多进步,早日升职加薪

  9. Centos7 中 Node.js安装简单方法

    这篇文章主要介绍了Centos7 中 Node.js安装简单方法,非常不错具有一定的参考借鉴价值,需要的朋友可以参考下

  10. nodejs脚本centos开机启动实操方法

    在本篇文章里小编给大家整理的是关于nodejs脚本centos开机启动实操方法,有兴趣的朋友们参考下。

随机推荐

  1. 在airgapped(离线)CentOS 6系统上安装yum软件包

    我有一个CentOS6系统,出于安全考虑,它已经被空气泄漏.它可能从未连接到互联网,如果有,它很长时间没有更新.我想将所有.rpm软件包放在一个驱动器上,这样它们就可以脱机安装而无需查询互联网.但是,我在测试VM上遇到的问题是,即使指定了本地路径,yum仍然会挂起并尝试从在线存储库进行更新.另外,有没有办法使用yum-utils/yumdownloader轻松获取该包的所有依赖项和所有依赖项?目前

  2. centos – 命名在日志旋转后停止记录到rsyslog

    CentOS6.2,绑定9.7.3,rsyslog4.6.2我最近设置了一个服务器,我注意到在日志轮换后,named已停止记录到/var/log/messages.我认为这很奇怪,因为所有日志记录都是通过rsyslog进行的,并且named不会直接写入日志文件.这更奇怪,因为我在更新区域文件后命名了HUPed,但它仍然没有记录.在我停止并重新启动命名后,记录恢复.这里发生了什么?

  3. centos – 显示错误的磁盘大小

    对于其中一个磁盘,Df-h在我的服务器上显示错误的空白区域:Cpanel表明它只有34GB免费,但还有更多.几分钟前,我删除了超过80GB的日志文件.所以,我确信它完全错了.fdisk-l/dev/sda2也显示错误:如果没有格式化,我该怎么做才能解决这个问题?并且打开文件描述符就是它需要使用才能做到这一点.所以…使用“lsof”并查找已删除的文件.重新启动写入日志文件的服务,你很可能会看到空间可用.

  4. 如何在centos 6.9上安装docker-ce 17?

    我目前正在尝试在centOS6.9服务器上安装docker-ce17,但是,当运行yuminstalldocker-ce时,我收到以下错误:如果我用跳过的标志运行它我仍然得到相同的消息,有没有人知道这方面的方法?

  5. centos – 闲置工作站的异常负载平均值

    我有一个新的工作站,具有不寻常的高负载平均值.机器规格是:>至强cpu>256GB的RAM>4x512GBSSD连接到LSI2108RAID控制器我从livecd安装了CentOS6.564位,配置了分区,网络,用户/组,并安装了一些软件,如开发工具和MATLAB.在启动几分钟后,工作站负载平均值的值介于0.5到0.9之间.但它没有做任何事情.因此我无法理解为什么负载平均值如此之高.你能帮我诊断一下这个问题吗?

  6. centos – Cryptsetup luks – 检查内核是否支持aes-xts-plain64密码

    我在CentOS5上使用cryptsetupluks加密加密了一堆硬盘.一切都很好,直到我将系统升级到CentOS6.现在我再也无法安装磁盘了.使用我的关键短语装载:我收到此错误:在/var/log/messages中:有关如何装载的任何想法?找到解决方案问题是驱动器使用大约512个字符长的交互式关键短语加密.出于某种原因,CentOS6中的新内核模块在由旧版本创建时无法正确读取512个字符的加密密钥.似乎只会影响内核或cryptsetup的不同版本,因为在同一系统上创建和打开时,512字符的密钥将起作用

  7. centos – 大量ssh登录尝试

    22个我今天登录CentOS盒找到以下内容这是过去3天内的11次登录尝试.WTF?请注意,这是我从我的提供商处获得的全新IP,该盒子是全新的.我还没有发布任何关于此框的内容.为什么我会进行如此大量的登录尝试?是某种IP/端口扫描?基本上有4名匪徒,其中2名来自中国,1名来自香港,1名来自Verizon.这只发生在SSH上.HTTP上没有问题.我应该将罪魁祸首子网路由吗?你们有什么建议?

  8. centos – kswap使用100%的CPU,即使有100GB的RAM也可用

    >Linux内核是否应该足够智能,只需从内存中清除旧缓存页而不是启动kswap?

  9. centos – Azure将VM从A2 / 3调整为DS2 v2

    我正在尝试调整前一段时间创建的几个AzureVM,从基本的A3和标准A3到标准的DS2v2.我似乎没有能力调整到这个大小的VM.必须从头开始重建服务器会有点痛苦.如果它有所不同我在VM中运行CentOS,每个都有一个带有应用程序和操作系统的磁盘.任何人都可以告诉我是否可以在不删除磁盘的情况下删除VM,创建新VM然后将磁盘附加到新VM?

  10. centos – 广泛使用RAM时服务器计算速度减慢

    我在非常具体的情况下遇到服务器速度下降的问题.事实是:>1)我使用计算应用WRF>2)我使用双XeonE5-2620v3和128GBRAM(NUMA架构–可能与问题有关!

返回
顶部