Tensorflow实现一个完整的CNN例子

使用了Tensorflow实现一个狗的类别的识别,模型中狗的类别一共为十种,数据集如下

链接: https://pan.baidu.com/s/1bpAjRkj 密码: jdc3

使用到的工具包是tfleran,可以直接使用pip安装 pip install tflearn

由于很多例子都是在mnist之类现有的数据集中跑的,当用到自己的数据集的时候,往往会比较麻烦

tflearn有现成的工具包可以将数据集转为hdf5格式供我们使用,只需要一个小小的准备

dog_10_images/n02085620-Chihuahua/n02085620_10074.jpg 0
dog_10_images/n02085620-Chihuahua/n02085620_10131.jpg 0
dog_10_images/n02085620-Chihuahua/n02085620_10621.jpg 0
dog_10_images/n02085620-Chihuahua/n02085620_1073.jpg 0
dog_10_images/n02085620-Chihuahua/n02085620_10976.jpg 0

生成类似这样的txt文件,后面0表示类别 ok 其代码如下

import os 
import re

def createFileList

你可能感兴趣的:(Tensorflow实现一个完整的CNN例子)