GithubHelp home page GithubHelp logo

yemenr / tensorflow_multigpu_imagenet Goto Github PK

View Code? Open in Web Editor NEW

This project forked from arashno/tensorflow_multigpu_imagenet

0.0 1.0 0.0 4.43 MB

Tensorflow code for training different architectures(DenseNet, ResNet, AlexNet, GoogLeNet, VGG, NiN) on ImageNet dataset + Multi-GPU support + Transfer Learning support

License: MIT License

Python 100.00%

tensorflow_multigpu_imagenet's Introduction

tensorflow_multigpu_imagenet

Code for training different architectures of image classification (i.e. DenseNet, ResNet, AlexNet, GoogLeNet, VGG, NiN) on ImageNet or other large datasets + Multi-GPU support + Transfer Learning support

This repository provides an easy-to-use way for training different well-known deep learning architectures on different large datasets. The code reads dataset information from a text or csv file and directly loads images from disk. Moreover, multi-GPU and transfer learning are supported.


New features are added
Completely redesigned, now more object oriented
Now compatible with both Python 2.7 and Python 3.6
Efficient snapshot saving
More options for selecting optimization algorithm
More options for learning rate and weight decay policies
Tuned architectures and bug fix
More readable code Now supports named classes in CSV file


This code got inspiration from these repositories:

https://github.com/soumith/imagenet-multiGPU.torch

https://github.com/ry/tensorflow-resnet

https://github.com/tensorflow/models/tree/master/tutorials/image/cifar10

#Example of usages:

To start, an input text file is needed. In the input text file, each line contain an image address and its associated label in numeric form:

train/n01440764/n01440764_7173.JPEG,0
train/n01440764/n01440764_3724.JPEG,0
train/n01440764/n01440764_7719.JPEG,0
train/n01440764/n01440764_7304.JPEG,0
train/n01440764/n01440764_8469.JPEG,0

Use the --delimiter option to specify the delimiter character, and --path_prefix to add a constant prefix to all the paths.

For training execute run.py with train command and your appropriate argument. For example, to train the VGG architecture on the ImageNet dataset with Adam optimizer for 50 epochs execute this:

python run.py train --architecture vgg --path_prefix /path..to..train/ --train_info train.txt --optimizer adam --num_epochs 50 

To evaluate a trained model (example):

python run.py eval --num_threads 8 --architecture alexnet --log_dir "alexnet_Run-17-07-2017-15:31:57" --path_prefix /project/datasets/imagenet/train/ --val_info val.txt

To test a trained model on data (example):

python run.py inference --num_threads 8 --architecture alexnet --log_dir "alexnet_Run-17-07-2017-15:31:57" --path_prefix /project/datasets/imagenet/train/ --val_info val.txt --save_predictions preds.txt

Transfer learning (example):

python run.py train --transfer_mode 1 --architecture alexnet --retrain_from ./alexnet_Run-17-07-2017-15:31:57 --optimizer momentum --LR_policy constant --LR_details 0.001

tensorflow_multigpu_imagenet's People

Contributors

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