Giter VIP home page Giter VIP logo

inceptionv4's Introduction

InceptionV4

N|Solid

Build Status

Keras implementation of InceptionV4 paper: http://arxiv.org/pdf/1602.07261v1.pdf InceptionV4

Done

  • Keras version update
  • Multi-GPU support
  • Comes with IPYNB file
  • Made UX Better

Installation

Python 3.6+ CUDA and cuDNN required for training.

Clone to the repository and install requirements.

$ git clone https://github.com/systemcorp-ai/InceptionV4
$ cd InceptionV4
$ pip install -r requirements.txt

Use .IPYNB file in case you're training it on Google Colaboratory

Split dataset into train and validation partitions

Arguments

  • # of GPUs

- "-g", "--gpus", default='single', type=int 
  • Train dataset directory

"-train", "--train_dir", type=str, default="train/"
  • Validation dataset directory

"-val", "--val", type=str, default="val/"
  • Checkpoint directory. Default is 'no', in case you're training from scratch

"-c", "--checkpoint", type=str, default="no"
  • # of Classes

"-classes", "--num_classes", type=int, required=True
  • # of Epochs

"-epochs", "--epochs", type=int, default=1000
  • # Steps per epoch

"-steps", "--steps_per_epoch", type=int, default=500
  • Learning Rate

"-lr", "--learning_rate", type=str, default='1e-3'

Example

python3 inceptionv4.py -g 8 -train train -val val -classes 20 -epochs 100 -steps 500

A little UX

In case you're willing to execute the code on Cloud, and want it to run as a background process, use Nohup for it. Nohup basically runs the code in background, and you can reach it easily, in case you're willing to see the progress.

  • Example to run
nohup python3 inceptionv4.py -g 8 -train train -val val -classes 20 -epochs 100 -steps 500 &

The Nohup will create nohup.out file.

  • To tail the progress via nohup.out file
tail -f nohup.out
  • To cat the whole progress via nohup.out file
cat nohup.out

Must-to-know

After nohup is executed, the way to kill the process is via Htop. Make sure to run it as an administrator.

  • Example
 sudo htop
  • List the processes via "S", or - which processes are parent ones. The parent processes will have "R" letter as shown in image, and kill them via F9, and then 9 + Enter.

Inception

Output

  1/500 [..............................] - ETA: 4:01 - loss: 2.7470 - acc: 0.3125
  2/500 [..............................] - ETA: 4:04 - loss: 2.4298 - acc: 0.4062
  3/500 [..............................] - ETA: 4:03 - loss: 2.3062 - acc: 0.4167
  4/500 [..............................] - ETA: 4:03 - loss: 2.1503 - acc: 0.4453
  5/500 [..............................] - ETA: 4:04 - loss: 1.9956 - acc: 0.4875
  6/500 [..............................] - ETA: 4:05 - loss: 1.9978 - acc: 0.4948
  7/500 [..............................] - ETA: 4:06 - loss: 2.0658 - acc: 0.4777
  8/500 [..............................] - ETA: 4:16 - loss: 2.0575 - acc: 0.4844
  9/500 [..............................] - ETA: 4:23 - loss: 2.1001 - acc: 0.4792
 10/500 [..............................] - ETA: 4:30 - loss: 2.1054 - acc: 0.4781
 11/500 [..............................] - ETA: 4:36 - loss: 2.1133 - acc: 0.4773
 12/500 [..............................] - ETA: 4:40 - loss: 2.1363 - acc: 0.4740
 13/500 [..............................] - ETA: 4:45 - loss: 2.1333 - acc: 0.4760
 14/500 [..............................] - ETA: 4:48 - loss: 2.1472 - acc: 0.4732
 15/500 [..............................] - ETA: 4:50 - loss: 2.1248 - acc: 0.4813
 16/500 [..............................] - ETA: 4:52 - loss: 2.1280 - acc: 0.4805
 17/500 [>.............................] - ETA: 4:54 - loss: 2.1657 - acc: 0.4706
 18/500 [>.............................] - ETA: 4:55 - loss: 2.1685 - acc: 0.4705
 19/500 [>.............................] - ETA: 4:56 - loss: 2.1693 - acc: 0.4688
 20/500 [>.............................] - ETA: 4:57 - loss: 2.1582 - acc: 0.4734

After finishing training, the model will save the best checkpoint in checkpoints directory.

Special Thanks to @titu1994 for initial implementation

https://github.com/titu1994/Inception-v4

Contributors

License

MIT

inceptionv4's People

Contributors

systemcorp-ai avatar

Watchers

James Cloos 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.