TensorFlow安装部署

简介: 1.环境依赖 Centos7 组件 版本 Python 2.7.5 TensorFlow 0.14.0 pyhton依赖库 Package Version -------------------- --------- absl-py 0.

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
目录
相关文章
|
2月前
|
并行计算 TensorFlow 算法框架/工具
Tensorflow2 环境搭建
Tensorflow2 环境搭建
42 0
|
3月前
|
机器学习/深度学习 算法 TensorFlow
TensorFlow 2.0 快速入门指南:第二部分
TensorFlow 2.0 快速入门指南:第二部分
|
10月前
|
TensorFlow 算法框架/工具 Python
【学习】TensorFlow2环境配置
【学习】TensorFlow2环境配置
55 0
|
12月前
|
TensorFlow 算法框架/工具 异构计算
tensorflow-gpu-2.3.1安装 tensorflow安装 GPU版本tensorflow安装 tensorflow搭建
tensorflow-gpu-2.3.1安装 tensorflow安装 GPU版本tensorflow安装 tensorflow搭建
356 0
|
Ubuntu TensorFlow 算法框架/工具
最新 Tensorflow 2.2极简安装教程 | 学习笔记
快速学习最新 Tensorflow 2.2极简安装教程
312 0
最新 Tensorflow 2.2极简安装教程 | 学习笔记
|
并行计算 TensorFlow 算法框架/工具
Tensorflow 2.0 GPU 版本的安装 | 学习笔记
快速学习 Tensorflow 2.0 GPU 版本的安装
272 0
Tensorflow 2.0 GPU 版本的安装 | 学习笔记
|
并行计算 PyTorch 测试技术
TensorFlow安装教程
TensorFlow安装教程
TensorFlow安装教程
|
Linux TensorFlow 算法框架/工具
Linux安装tensorflow
Linux安装tensorflow
645 2
Linux安装tensorflow
|
机器学习/深度学习 Ubuntu Linux
TensorFlow环境搭建
前几天,我们刚下发了毕业设计的题目,我选的题目为基于TensorFlow的深度学习与研究,这将会是一个系列文章,截止2020-07我会将所有相关内容用更加通俗易懂的方式发布在公众平台上,我们一块学习,让我们嗨起来~。
TensorFlow环境搭建
|
TensorFlow 算法框架/工具 Python
tensorflow环境准备
tensorflow环境准备
114 0
tensorflow环境准备