Coder Social home page Coder Social logo

cwyd0822 / cifar10-tensorflow-read-write Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 2.0 32 KB

通过Tensorflow将Cifar10数据转换成图像,并且对图像数据序列化为tfrecord数据。本项目对tfrecord的读写操作进行了演示,对代码详细注释。代码和文档将持续更新和优化。

License: MIT License

Python 100.00%
tensorflow cifar10 tfrecord python

cifar10-tensorflow-read-write's Introduction

cifar10-tensorflow-read-write

本项目通过Tensorflow对Cifar10数据集进行读写操作。

包括完整代码和详细注释。

Cifar10数据集介绍

  • 由60000个图片组成
  • 6万个图片中,5万张用于训练,1万张用于测试
  • 每个图片是32x32像素
  • 所有图片可以分成10类
  • 每个图片都有一个标签,标记属于哪一个类
  • 测试集中一个类对应1000张图
  • 训练集中将5万张图分为5份
  • 类之间的图片是互斥的,不存在类别重叠的情况

Cifar10数据集分类

分类

Cifar10数据集下载

项目运行需要的环境

  • Python 3.7.4
  • TensorFlow 1.5.0

项目运行

convert_cifar10_image.py

这个脚本对数据进行下载,并且转换成图片 首先将文件中下面三行的注释移除

DATA_URL = 'http://www.cs.toronto.edu/~kriz/cifar-10-python.tar.gz'
DATA_DIR = 'data'
download_and_uncompress_tarball(DATA_URL, DATA_DIR)

并且执行

python3 convert_cifar10_image.py

这样脚本会自动下载数据,并且转换成图片。其中训练数据在data/image/train目录下。 如果在线下载比较慢,可以通过百度网盘先将数据集下载到项目根目录下,再执行这个convert_cifar10_image.py脚本,这样会自动跳过从网络上下载。

cifar10数据通过tensorflow转换成图像

《cifar10数据通过tensorflow转换成图像》

tf.train.slice_input_producer()和tf.train.string_input_producer函数

《详解tensorflow的tf.train.slice_input_producer和tf.train.string_input_producer生成器》

以Cifar10图像数据为例详解tensorflow对tfrecord数据的读写操作

《以Cifar10图像数据为例详解tensorflow对tfrecord数据的读写操作》

详解tensorflow之tf.train.batch与tf.train.shuffle_batch附完整代码

《详解tensorflow之tf.train.batch与tf.train.shuffle_batch附完整代码》

cifar10-tensorflow-read-write's People

Contributors

cwyd0822 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.