Alluxio使用——TensorFlow篇

简介: 1.安装部署TensorFlow安装部署Alluxio安装部署SSH免密登陆2.使用1).创建alluxio根目录[bigdata@carbondata alluxio-2.0.0]$ .

1.安装部署

TensorFlow安装部署
Alluxio安装部署

SSH免密登陆

2.使用

1).创建alluxio根目录

[bigdata@carbondata alluxio-2.0.0]$ ./bin/alluxio fs mkdir /training-data
Successfully created directory /training-data

2).创建本地目录,并挂载到alluxio根目录

a).创建本地目录

mkdir -p /home/bigdata/data

b).挂载到alluxio根目录

[bigdata@carbondata alluxio-2.0.0]$ ./integration/fuse/bin/alluxio-fuse mount /home/bigdata/data /training-data
Starting alluxio-fuse on local host.
Successfully mounted Alluxio path "/training-data" to /home/bigdata/data.
See /home/bigdata/alluxio-2.0.0/logs/fuse.log for logging messages

c).验证挂载状态

[bigdata@carbondata alluxio-2.0.0]$ ./integration/fuse/bin/alluxio-fuse stat
pid     mount_point     alluxio_path
11074   /home/bigdata/data      /training-data

3).准备测试数据

a).下载测试数据

inception-2015-12-05

wget http://download.tensorflow.org/models/image/imagenet/inception-2015-12-05.tgz

b).测试数据上传至alluxio

## 创建数据目录
[bigdata@carbondata alluxio-2.0.0]$ ./bin/alluxio fs mkdir /training-data/imagenet
Successfully created directory /training-data/imagenet

## 上传数据
[bigdata@carbondata alluxio-2.0.0]$ ./bin/alluxio fs copyFromLocal /home/bigdata/inception-2015-12-05.tgz /training-data/imagenet 
Failed to cache: There is no worker with enough space for a new block of size 536,870,912

[bigdata@carbondata alluxio-2.0.0]$ ./bin/alluxio fs copyFromLocal /home/bigdata/inception-2015-12-05.tgz /training-data/imagenet 
Copied file:///home/bigdata/inception-2015-12-05.tgz to /training-data/imagenet


4).图像识别测试

下载脚本

curl -o classify_image.py -L https://raw.githubusercontent.com/tensorflow/models/master/tutorials/image/imagenet/classify_image.py

运行脚本

(tensorflow) [bigdata@carbondata tensorflow_data]$ python classify_image.py --model_dir /home/bigdata/data/imagenet
WARNING:tensorflow:From classify_image.py:227: The name tf.app.run is deprecated. Please use tf.compat.v1.app.run instead.

WARNING:tensorflow:From classify_image.py:139: The name tf.gfile.Exists is deprecated. Please use tf.io.gfile.exists instead.

W0829 21:25:37.012851 139730996795200 deprecation_wrapper.py:119] From classify_image.py:139: The name tf.gfile.Exists is deprecated. Please use tf.io.gfile.exists instead.

WARNING:tensorflow:From classify_image.py:141: __init__ (from tensorflow.python.platform.gfile) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.gfile.GFile.
W0829 21:25:39.488382 139730996795200 deprecation.py:323] From classify_image.py:141: __init__ (from tensorflow.python.platform.gfile) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.gfile.GFile.
WARNING:tensorflow:From classify_image.py:125: The name tf.GraphDef is deprecated. Please use tf.compat.v1.GraphDef instead.

W0829 21:25:41.580853 139730996795200 deprecation_wrapper.py:119] From classify_image.py:125: The name tf.GraphDef is deprecated. Please use tf.compat.v1.GraphDef instead.

2019-08-29 21:26:31.840733: W tensorflow/core/framework/op_def_util.cc:357] Op BatchNormWithGlobalNormalization is deprecated. It will cease to work in GraphDef version 9. Use tf.nn.batch_normalization().
WARNING:tensorflow:From classify_image.py:146: The name tf.Session is deprecated. Please use tf.compat.v1.Session instead.

W0829 21:27:04.229350 139730996795200 deprecation_wrapper.py:119] From classify_image.py:146: The name tf.Session is deprecated. Please use tf.compat.v1.Session instead.

2019-08-29 21:27:04.889623: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2019-08-29 21:27:05.865288: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 3600000000 Hz
2019-08-29 21:27:05.888049: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x557e570 executing computations on platform Host. Devices:
2019-08-29 21:27:05.888110: I tensorflow/compiler/xla/service/service.cc:175]   StreamExecutor device (0): <undefined>, <undefined>
2019-08-29 21:27:07.301608: W tensorflow/core/framework/allocator.cc:107] Allocation of 8257536 exceeds 10% of system memory.
2019-08-29 21:27:07.357415: W tensorflow/core/framework/allocator.cc:107] Allocation of 8257536 exceeds 10% of system memory.
2019-08-29 21:27:07.359446: W tensorflow/core/framework/allocator.cc:107] Allocation of 8257536 exceeds 10% of system memory.
2019-08-29 21:27:07.431136: W tensorflow/core/framework/allocator.cc:107] Allocation of 8257536 exceeds 10% of system memory.
2019-08-29 21:27:07.593467: W tensorflow/core/framework/allocator.cc:107] Allocation of 8257536 exceeds 10% of system memory.
2019-08-29 21:27:08.113432: W tensorflow/compiler/jit/mark_for_compilation_pass.cc:1412](One-time warning): Not using XLA:CPU for cluster because envvar TF_XLA_FLAGS=--tf_xla_cpu_global_jit was not set.  If you want XLA:CPU, either set that envvar, or use experimental_jit_scope to enable XLA:CPU.  To confirm that XLA is active, pass --vmodule=xla_compilation_cache=1 (as a proper command-line flag, not via TF_XLA_FLAGS) or set the envvar XLA_FLAGS=--xla_hlo_profile.
WARNING:tensorflow:From classify_image.py:85: The name tf.gfile.GFile is deprecated. Please use tf.io.gfile.GFile instead.

W0829 21:27:11.583446 139730996795200 deprecation_wrapper.py:119] From classify_image.py:85: The name tf.gfile.GFile is deprecated. Please use tf.io.gfile.GFile instead.

giant panda, panda, panda bear, coon bear, Ailuropoda melanoleuca (score = 0.89107)
indri, indris, Indri indri, Indri brevicaudatus (score = 0.00779)
lesser panda, red panda, panda, bear cat, cat bear, Ailurus fulgens (score = 0.00296)
custard apple (score = 0.00147)
earthstar (score = 0.00117)
目录
相关文章
|
1月前
|
TensorFlow 算法框架/工具
第2章 TensorFlow 基础
第2章 TensorFlow 基础
27 0
|
1月前
|
TensorFlow 算法框架/工具
TensorFlow基础
TensorFlow基础
26 0
|
12月前
|
TensorFlow 算法框架/工具 异构计算
tensorflow-gpu-2.3.1安装 tensorflow安装 GPU版本tensorflow安装 tensorflow搭建
tensorflow-gpu-2.3.1安装 tensorflow安装 GPU版本tensorflow安装 tensorflow搭建
356 0
|
存储 监控 TensorFlow
如何运行 TensorFlow 分布式训练|学习笔记
快速学习如何运行 TensorFlow 分布式训练
93 0
|
机器学习/深度学习 弹性计算 JSON
Tensorflow Serving部署模型与调用
本文以mnist为数据集,使用keras 构建CNN网络,将训练获取的模型通过Tensorflow Serving方式部署提供Rest Full接口,分别使用PostMan和Python调用服务,代码编辑调试使用阿里云PAI DSW实例,模型部署使用阿里云ECS虚拟机。
62626 2
Tensorflow Serving部署模型与调用
|
存储 Kubernetes 算法
kubeflow系列(三):模型即服务,关于tensorflow serving的使用
模型即服务(Model as a service)作为算法模型最优雅的价值变现,也是最佳的tf算法部署实践,Tensorflow Serving 作为Tensorflow官方的模型部署方案,也是kubeflow默认的一种tensorflow部署形式,本文介绍如何用 Tensorflow Serving 部署算法模型。
2064 0
|
TensorFlow 算法框架/工具 Python
TensorFlow安装部署
1.环境依赖 Centos7 组件 版本 Python 2.7.5 TensorFlow 0.14.0 pyhton依赖库 Package Version -------------------- --------- absl-py 0.
1898 0
|
Serverless Shell TensorFlow
开发函数计算的正确姿势——tensorflow serving
前言 首先介绍下在本文出现的几个比较重要的概念: 函数计算(Function Compute): 函数计算是一个事件驱动的服务,通过函数计算,用户无需管理服务器等运行情况,只需编写代码并上传。函数计算准备计算资源,并以弹性伸缩的方式运行用户代码,而用户只需根据实际代码运行所消耗的资源进行付费。
3723 0
|
机器学习/深度学习 人工智能 TensorFlow
TensorFlow 携手 NVIDIA,使用 TensorRT 优化 TensorFlow Serving 性能
二者相结合后,用户可以轻松地实现 GPU 推理,并获得更佳的性能。
1465 0
|
算法 TensorFlow 算法框架/工具
Tensorflow源码解析7 -- TensorFlow分布式运行时
# 1 概述 TensorFlow架构设计精巧,在后端运行时这一层,除了提供本地运行时外,还提供了分布式运行时。通过分布式训练,在多台机器上并行执行,大大提高了训练速度。前端用户通过session.run()启动系统执行时,target默认为空字符串"",对应的是本地运行模式。若target以"grpc://"开头,则对应的是分布式运行模式,target指定了要连接的TensorFlow执行
2064 0