Giter VIP home page Giter VIP logo

tf-slim-mnist's Introduction

tf-slim-mnist

MNIST tutorial with Tensorflow Slim (tf.contrib.slim) a lightweight library over Tensorflow, you can read more about it here and here is a good ipython notebook about it

Setting up data

run python datasets/download_and_convert_mnist.py to create [train, test].tfrecords files containing MNIST data by default (unless you specify --directory) they will be put into /tmp/mnist

Running

Run the training, validation, and tensorboard concurrently. The results of the training and validation should show up in tensorboard.

Running the training

run mnist_train.py which will read train.tfrecords using an input queue and output its model checkpoints, and summaries to the log directory (you can specify it with --log_dir)

Running the validation

run mnist_eval.py which will read test.tfrecords using an input queue, and also read the train models checkpoints from log/train (by default). It will then load the model at that checkpoint and run it on the testing examples, outputting the summaries and log to its own folder log/eval (you can specify it with --log_dir)

Running tensorboard

Tensorboard allows you to keep track of your training in a nice and visual way. It will read the logs from the training and validation and should update on its own though you may have to refresh the page manually sometimes.

Make sure both training and validation output their summaries to one log directory and preferably under their own folder. Run tensorboard --logdir=log (replace log with your own log folder if you changed it).

If each process has its own folder then train and validation should have their own colour and checkbox

Notes

Woah, data input seems pretty different from what it used to be

Tensorflow has really changed the way they're doing data input (for the better!) and though the new way seems pretty complicated (with queue runners etc...) it isn't that bad and can potentially make everything much faster, better.

I'm trying to keep up with all the changes but if something seems off to you, then please open an issue or create a pull request!

Where did you get all those files in /dataset ?

I took those files from the tensorflow/models repo in the tensorflow slim folder here. I modified download_and_convert_mnist.py just a little so it can be run as a standalone program, and took only the files you need to run a lenet architechture for mnist.

How do I do more than MNIST?

Modify the model file with whatever model you want, change the data input (maybe look at the datasets already available in slim).

tf-slim-mnist's People

Watchers

James Cloos avatar Bhavesh Jaiswal 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.