How to set up Tensorflow inception-v3 model on Windows
There is Inception-v3 model python implementation on GitHub at: https://github.com/tensorflow/models/tree/master/inception
There are several shell scripts in /inception/inception/data folder. these scripts only can run on Linux OS, especially on Ubuntu. So. how can we set up the Inception-v3 model on Windows. let's dive into these scripts code.
In download_and_preprocess_flowers.sh. first, the script download flower_photo.tgz file from the web. second, make some directories and set some environment. these folders are used to store flowers data and flower train and validate data after processing. almost environment variables are used as the argument in last scripts call.
- DATA_DIR : root directory after unpacking flower_photo.tgz file.
- TRAIN_DIRECTORY : the sub-directory of flower data. always be "flowers-data/raw-data/train".
- VALIDATION_DIRECTORY: the sub-directory of flower data that store pictures for validating. always be "flowers-data/raw-data/validation".
- LABELS_FILE: the file path of lable.txt, always be "flowers-data/raw-data/labels.txt".
- OUTPUT_DIRECTORY : somewhere to store processed data.
Then, the script will call another script build_image_data.py.
There are some arguments in this script. we can use environment variables we just set before or set the specific path to these arguments. notice, we just call the build_image_data.py script directly with a command: python build_image_data.py --train_directory="${TRAIN_DIRECTORY}" --validation_directory="${VALIDATION_DIRECTORY}" --output_directory="${OUTPUT_DIRECTORY}" --labels_file="${LABELS_FILE}
this script will convert separated pictures to a union file batch with TFRecords format with Examples protos.
The Example proto:
contains the following fields:
image/encoded: string containing JPEG encoded image in RGB colorspace
image/height: integer, image height in pixels
image/width: integer, image width in pixels
image/colorspace: string, specifying the colorspace, always 'RGB'
image/channels: integer, specifying the number of channels, always 3
image/format: string, specifying the format, always'JPEG'
image/filename: string containing the basename of the image file
e.g. 'n01440764_10026.JPEG' or 'ILSVRC2012_val_00000293.JPEG'
image/class/label: integer specifying the index in a classification layer.
The label ranges from [0, num_labels] where 0 is unused and left as
the background class.
image/class/text: string specifying the human-readable version of the label
e.g. 'dog'
After processing, we can find some training and validation files in the DATA_DIR.
Before training. we have to do some adjustment to the source code. because Inception-v3 is written with an older version of tensorflow. some API has already discarded.
- tf.scalar_summary -> tf.summary.scalar
- tf.histogram_summary -> tf.summary.histogram
- tf.merge_summary -> tf.summary.merge
- tf.train.SummaryWriter -> tf.summary.FileWriter
- tf.concat(0,[ymin, xmin, ymax, xmax]) -> tf.concat([ymin, xmin, ymax, xmax],0) switch argument.
Maybe, there also has some error. just look up tensorflow documentation and change it.
We also need to do one step in addition before we start training. cause these python scripts are separated not in a python package. we need to add an empty __init__.py file to inception folder. and make a replica of flowers_train.py on parent-directory. then execute this script.
Make sure you have already installed tensorflow on your windows. notice, tensorflow only supports python 3.4+ on Windows, and there are two types tensorflow, one is CPU only, another is tensorflow-GPU. if you have a GPU have enough compute ability, you can choose the GPU version. check Installing guide on the tensorflow website is helpful. https://www.tensorflow.org/install/install_windows
We will discuss some arguments in flower_train.py in after articles.
How to set up Tensorflow inception-v3 model on Windows的更多相关文章
- 脸型分类-Face shape classification using Inception v3
本文链接:https://blog.csdn.net/u011961856/article/details/77984667函数解析github 代码:https://github.com/adoni ...
- Inception V3 的 tensorflow 实现
tensorflow 官方给出的实现:models/inception_v3.py at master · tensorflow/models · GitHub 1. 模型结构 首先来看 Incept ...
- 源码分析——迁移学习Inception V3网络重训练实现图片分类
1. 前言 近些年来,随着以卷积神经网络(CNN)为代表的深度学习在图像识别领域的突破,越来越多的图像识别算法不断涌现.在去年,我们初步成功尝试了图像识别在测试领域的应用:将网站样式错乱问题.无线领域 ...
- 微调Inception V3网络-对Satellite分类
目录 1. 流程概述 2. 准备数据集 2.1 Satellite数据集介绍 3. Inception V3网络 4. 训练 4.1 基于Keras微调Inception V3网络 4.2 Keras ...
- 1、VGG16 2、VGG19 3、ResNet50 4、Inception V3 5、Xception介绍——迁移学习
ResNet, AlexNet, VGG, Inception: 理解各种各样的CNN架构 本文翻译自ResNet, AlexNet, VGG, Inception: Understanding va ...
- How to setup Tensorflow inception-v3 model on Windows
There is Inception-v3 model python implementation on GitHub at: https://github.com/tensorflow/models ...
- 网络结构解读之inception系列四:Inception V3
网络结构解读之inception系列四:Inception V3 Inception V3根据前面两篇结构的经验和新设计的结构的实验,总结了一套可借鉴的网络结构设计的原则.理解这些原则的背后隐藏的 ...
- 从GoogLeNet至Inception v3
从GoogLeNet至Inception v3 一.CNN发展纵览 我们先来看一张图片: 1985年,Rumelhart和Hinton等人提出了后向传播(Back Propagation,BP)算法( ...
- 经典分类CNN模型系列其五:Inception v2与Inception v3
经典分类CNN模型系列其五:Inception v2与Inception v3 介绍 Inception v2与Inception v3被作者放在了一篇paper里面,因此我们也作为一篇blog来对其 ...
随机推荐
- overflow:hidden 你所不知道的事
overflow:hidden 你所不知道的事 overflow:hidden这个CSS样式是大家常用到的CSS样式,但是大多数人对这个样式的理解仅仅局限于隐藏溢出,而对于清除浮动这个含义不是很了解. ...
- php数组排序
sort() - 以升序对数组排序rsort() - 以降序对数组排序asort() - 根据值,以升序对关联数组进行排序ksort() - 根据键,以升序对关联数组进行排序arsort() - 根据 ...
- 如何使用Babel将ES6转码为ES5?
一.前言: 当我们还在沉迷于ES5的时候,殊不知ES6早就已经发布几年了.时代在进步,WEB前端技术也在日新月异,是时候做些改变了! ECMAScript 6(ES6)的发展速度非常之快,但现代浏览器 ...
- (原)SQL Server 系统提供功能的三个疑惑
本文目录列表: 1.SQL Server系统提供的部分疑惑概述2.系统函数调用时DEFAULT代替可选参数使用不统一3.队列字段列message_enqueue_time记录的是UTC日期时间 4.@ ...
- wamp修改空密码以及设置虚拟站点
近来重装了一下wamp,索性记录一下,wamp安装完后,我的常用配置.首先,肯定要修改默认的空密码:其次,便要配置虚拟站点,因为当项目多的时候,每个项目分配成一个站点,对于开发来说,很方便管理.其实网 ...
- CSS Flexbox 学习指南、工具与框架
Flexbox 是一种更有效的布局方式,它能更好的分配容器空间,并控制项目的对齐.虽然,掌握它的理论有些复杂,但幸运的是,我们可以借助开放的网络来学习并逐步掌握它. 在本文中,我们整合了一些最佳的 F ...
- php单例模式与工厂模式
单例模式:单例模式又称为职责模式,它用来在程序中创建一个单一功能的访问点,通俗地说就是实例化出来的对象是唯一的. 所有的单例模式至少拥有以下三种公共元素:1. 它们必须拥有一个构造函数,并且必须被标记 ...
- Javascript基本概念(一)
JavaScript基本语法: ECMAScript的语法大量借鉴了C以及其他类C语言的语法. ECMAScript中的一切(变量.函数名.操作符)都区分大小写. 标识符: 含义:指变量.函数.属性的 ...
- Ajax异步获取html数据中包含js方法无效的解决方法
页面上使用js写了一个获取后台数据的方法 function data() { var tab = $("#dic") $.ajax({ url: '../demo.ashx?met ...
- FZU 1889 龟兔赛跑
Problem 1889 龟兔赛跑 Accept: 1240 Submit: 1650Time Limit: 1000 mSec Memory Limit : 32768 KB Probl ...