Coder Social home page Coder Social logo

mobilenetv3_keras's Introduction

MobileNet V3


Requirments

numpy 1.15.1
keras 2.2.4
tensorflow-gpu 1.9.0
opencv-python 3.4.3.18
imgaug 0.2.8

Training

  • You can define taining learning rate schedule by edit src/learning_rate_schedule.py.
python train.py -c config/train.ini

Arguments

  • data
  • model
  • train
  • gpu

data

Argument Description Type Default
train Training dataset directory. str None
valid Validation dataset directory. str None

model

Argument Description Type Default
input_size Input size of MobileNet V3 model. int 224
model_size "large" or "small" version of MobileNet V3 model. str large
pooling_type Pooling type of MobileNet V3 model. (avg or depthwith) str avg
num_classes Number of classes. int 1000

train

Argument Description Type Default
epochs Maximun number of training epochs. int 200
batch_size Batch size of data generator. int 32
save_path Saved weights path. str weights/*.h5
pretrained_path Pre-trained model path of MobileNet V3 model. str None

gpu

Argument Description Type Default
gpu Specify a GPU. str -1

bottleneck structure configuation

  • You can define custom bottleneck structure by edit large_config_list and small_config_list in MobileNet_V3.py
Argument Description Type Code
out_dim Output chennal dimension. int out
kernel Kernel size of filter. tuple kernel
strides Strides of the converlutional operation. tuple stride
expansion_dim Expansion dimension of the bottleneck block. int exp
is_use_bias Use bias or not. bool bias
res Use shortcut operation or not. bool res
is_use_se Use SE block or not. bool se
activation Activative functions. ('RE' or 'HS') str active
num_layers Layer index number. int id

example

# NOTE               out   kernel  stride  exp  bias   res    se     active id  
large_config_list = [[16,  (3, 3), (1, 1), 16,  False, False, False, 'RE',  0],
                     [24,  (3, 3), (2, 2), 64,  False, False, False, 'RE',  1],
                     [24,  (3, 3), (1, 1), 72,  False, True,  False, 'RE',  2],
                     [40,  (5, 5), (2, 2), 72,  False, False, True,  'RE',  3],
                     [40,  (5, 5), (1, 1), 120, False, True,  True,  'RE',  4],
                     [40,  (5, 5), (1, 1), 120, False, True,  True,  'RE',  5],
                     [80,  (3, 3), (2, 2), 240, False, False, False, 'HS',  6],
                     [80,  (3, 3), (1, 1), 200, False, True,  False, 'HS',  7],
                     [80,  (3, 3), (1, 1), 184, False, True,  False, 'HS',  8],
                     [80,  (3, 3), (1, 1), 184, False, True,  False, 'HS',  9],
                     [112, (3, 3), (1, 1), 480, False, False, True,  'HS', 10],
                     [112, (3, 3), (1, 1), 672, False, True,  True,  'HS', 11],
                     [160, (5, 5), (1, 1), 672, False, False, True,  'HS', 12],
                     [160, (5, 5), (2, 2), 672, False, True,  True,  'HS', 13],
                     [160, (5, 5), (1, 1), 960, False, True,  True,  'HS', 14]]

mobilenetv3_keras's People

Contributors

godofpdog avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

mobilenetv3_keras's Issues

tensorflow-gpu 1.9.0 not available

Hi godofpdog,

Will this work for any other versions of tensorflow-gpu?
ERROR: Could not find a version that satisfies the requirement tensorflow-gpu==1.9.0 (from versions: 2.2.0rc1, 2.2.0rc2, 2.2.0rc3, 2.2.0rc4, 2.2.0, 2.2.1, 2.3.0rc0, 2.3.0rc1, 2.3.0rc2, 2.3.0, 2.3.1)
ERROR: No matching distribution found for tensorflow-gpu==1.9.0

`Sanket

line 72 in .py file

x = __depthwise_block(_inputs, kernel=kernel, strides=strides, is_use_se=is_use_se, activation=activation)

should be

x = __depthwise_block(x, kernel=kernel, strides=strides, is_use_se=is_use_se, activation=activation)

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.