TensorFlow安装部署
1.环境依赖
Centos7
组件 | 版本 |
---|---|
Python | 2.7.5 |
TensorFlow | 0.14.0 |
pyhton依赖库
Package Version -------------------- --------- absl-py 0.8.0 astor 0.8.0 backports.weakref 1.0.post1 enum34 1.1.6 funcsigs 1.0.2 futures 3.3.0 gast 0.2.2 google-pasta 0.1.7 grpcio 1.23.0 h5py 2.9.0 Keras-Applications 1.0.8 Keras-Preprocessing 1.1.0 Markdown 3.1.1 mock 3.0.5 numpy 1.16.5 pip 19.2.3 protobuf 3.9.1 setuptools 41.2.0 six 1.12.0 tensorboard 1.14.0 tensorflow 1.14.0 tensorflow-estimator 1.14.0 termcolor 1.1.0 Werkzeug 0.15.5 wheel 0.33.6 wrapt 1.11.2
2.资源准备
安装包下载
百度云盘链接:https://pan.baidu.com/s/1cm9mZpP1JRwyGpq945ffaQ
提取码:8bxj
3.安装
a).安装python-devel
## 在线安装 yum install python-devel ## 离线安装 rpm -ivh python-devel-2.7.5-80.el7_6.x86_64.rpm
b).安装virtualenv
## 在线安装 pip install virtualenv ## 离线安装
c).安装tensorflow
进入虚拟机,安装tensorflow
## Step1: 创建虚拟机 virtualenv tensorflow ## Step2: 进入虚拟机 source ./tensorflow/bin/activate
## 在线安装 pip install tensorflow ## 离线安装 pip install --no-index --find-links=/path/to/tensorflow_1.14.0_package -r tensorflow_requirement.txt
4.测试
测试代码
import tensorflow as tf mnist = tf.keras.datasets.mnist (x_train, y_train),(x_test, y_test) = mnist.load_data() x_train, x_test = x_train / 255.0, x_test / 255.0 model = tf.keras.models.Sequential([ tf.keras.layers.Flatten(input_shape=(28, 28)), tf.keras.layers.Dense(128, activation='relu'), tf.keras.layers.Dropout(0.2), tf.keras.layers.Dense(10, activation='softmax') ]) model.compile(optimizer='adam', loss='sparse_categorical_crossentropy', metrics=['accuracy']) model.fit(x_train, y_train, epochs=5) model.evaluate(x_test, y_test)
执行测试
python test.py
测试结果
5.环境依赖下载
## python-devel http://mirror.centos.org/centos/7/updates/x86_64/Packages/python-devel-2.7.5-80.el7_6.x86_64.rpm ## tensorflow-1.14.0 https://files.pythonhosted.org/packages/d3/59/d88fe8c58ffb66aca21d03c0e290cd68327cc133591130c674985e98a482/tensorflow-1.14.0-cp27-cp27mu-manylinux1_x86_64.whl ## pip-19.2.3 https://files.pythonhosted.org/packages/00/9e/4c83a0950d8bdec0b4ca72afd2f9cea92d08eb7c1a768363f2ea458d08b4/pip-19.2.3.tar.gz ## virtualenv https://files.pythonhosted.org/packages/f7/69/1ad2d17560c4fc60170056dcd0a568b83f3453a2ac91155af746bcdb9a07/virtualenv-16.7.4-py2.py3-none-any.whl

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。
持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。
转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。
- 上一篇
Python 小抄报
python备忘录大全 下载文档地址, PDF, Fork me on GitHub or Check out FAQ. 内容 1. Collections: List__,__ Dictionary__,__ Set__,__ Tuple__,__ Range__,__ Enumerate__,__ Iterator__,__ Generator__.__ 2. Types: Type__,__ String__,__ Regular_Exp__,__ Format__,__ Numbers__,__ Combinatorics__,__ Datetime__.__ 3. Syntax: Args__,__ Inline__,__ Closure__,__ Decorator__,__ Class__,__ Duck_Types__,__ Enum__,__ Exceptions__.__ 4. System: Print__,__ Input__,__ Command_Line_Arguments__,__ Open__,__ Path__,__ Command_E...
- 下一篇
java.io.File实现批量创建,递归目录查询、删除操作
今天使用java的File类实现了一个简单的创建多层级多维度的文件目录结构结构如下同时使用递归方法实现了文件的遍历查询和全部删除。(核心思想)判断文件是不是目录,如果是目录就进行递归调用,否则直接进行处理。下面看一下代码吧! import java.io.File; import java.io.IOException; /** * * @author jjking * @version v1.0 * * 创建时间: 2019年8月28日 下午3:10:27 * */ public class ClassWork01 { static final int NUM = 10; /** * 创建文件夹 * @param path 要创建的路径 */ public static void createFilesAndDirs(String path) { File file = new File(path); file.mkdir(); for (int i = 0; i < NUM; i++) { File file0 = new File(path +"\\"+ i); File ...
相关文章
文章评论
共有0条评论来说两句吧...
文章二维码
点击排行
推荐阅读
最新文章
- CentOS7安装Docker,走上虚拟化容器引擎之路
- SpringBoot2全家桶,快速入门学习开发网站教程
- MySQL8.0.19开启GTID主从同步CentOS8
- CentOS8,CentOS7,CentOS6编译安装Redis5.0.7
- CentOS7,CentOS8安装Elasticsearch6.8.6
- CentOS8编译安装MySQL8.0.19
- SpringBoot2整合MyBatis,连接MySql数据库做增删改查操作
- Springboot2将连接池hikari替换为druid,体验最强大的数据库连接池
- 设置Eclipse缩进为4个空格,增强代码规范
- SpringBoot2整合Thymeleaf,官方推荐html解决方案