Git Product home page Git Product logo

hansren1024 / tensorflow-preprocessing-training-testing Goto Github PK

View Code? Open in Web Editor NEW
15.0 3.0 8.0 237 KB

(non-distribution & distribution) Use Tensorflow to do classification containing data preparation, training, testing.(single computer single GPU & single computer multi-GPU & multi-computer multi-GPU)

Home Page: http://blog.csdn.net/renhanchi/article/details/79570665

Python 99.40% Shell 0.60%
tensorflow computer-vision cnn

tensorflow-preprocessing-training-testing's Introduction

Tensorflow-preprocessing-training-testing

(non-distribution & distribution)

Use Tensorflow to do classification containing data preparation, training, testing.(single computer single GPU & single computer multi-GPU & multi-computer multi-GPU)


中文博客地址: http://blog.csdn.net/renhanchi/article/details/79570665


All parameters are in arg_parsing.py. So before you start this program, you should read it carefully!

STEPS:

  1. Put all images in different diractories. Then run img2list.sh to create a txt file containing pathes and labels of all iamges.

    txt content

  2. Run list2bin.py to convert the images from rgb to tfrecords.

  3. For single computer, one GPU or more, whatever. Just run:

     python main.py
    
  4. For distribution, first you should modify PS_HOSTS and WORKER_HOSTS in arg_parsing.py. And then copy all dataset and codes to every server.

For ps host, run:

CUDA_VISIBLE_DEVICES='' python src/main.py --job_name=ps --task_index=0

CUDA_VISIBLE_DEVICES='' means using CPU to concat parameters.

For worker host, run:

python src/main.py --job_name=worker --task_index=0

Do remenber to increase task_index in every server.

  1. All ckpt and event files will be saved in MODEL_DIR.

  2. For testing, just run:

    python src/main.py --mode=testing
    

Notes

  1. DO READ arg_parsing.py again and again to understand and control this program.

  2. Use CUDA_VISIBLE_DEVICES=0,2 to choose GPUs.

  3. For visualization, run:

    tensorboard --logdir=models/
    
  4. More details, please see my blog above.

tensorflow-preprocessing-training-testing's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.