Unofficial implementation of MobileNetV3 architecture described in paper Searching for MobileNetV3.
This repository contains small and large MobileNetV3 architecture implemented using TensforFlow with tf.keras
API.
- Python 3.6+
- TensorFlow 1.13+
pip install -r requirements.txt
from mobilenetv3_factory import build_mobilenetv3
model = build_mobilenetv3(
"small",
input_shape=(224, 224, 3),
num_classes=1001,
width_multiplier=1.0,
)
from mobilenetv3_factory import build_mobilenetv3
model = build_mobilenetv3(
"large",
input_shape=(224, 224, 3),
num_classes=1001,
width_multiplier=1.0,
)
python train.py \
--model_type small \
--width_multiplier 1.0 \
--height 128 \
--width 128 \
--dataset cifar10 \
--lr 0.01 \
--optimizer rmsprop \
--train_batch_size 256 \
--valid_batch_size 256 \
--num_epoch 10 \
--logdir logdir
python train.py \
--model_type small \
--width_multiplier 1.0 \
--height 128 \
--width 128 \
--dataset mnist \
--lr 0.01 \
--optimizer rmsprop \
--train_batch_size 256 \
--valid_batch_size 256 \
--num_epoch 10 \
--logdir logdir
python evaluate.py \
--model_type small \
--width_multiplier 1.0 \
--height 128 \
--width 128 \
--dataset cifar10 \
--valid_batch_size 256 \
--model_path mobilenetv3_small_cifar10_10.h5
python evaluate.py \
--model_type small \
--width_multiplier 1.0 \
--height 128 \
--width 128 \
--dataset mnist \
--valid_batch_size 256 \
--model_path mobilenetv3_small_mnist_10.h5
Graph, training and evaluaion metrics are saved to TensorBoard event file uder directory specified with --logdir` argument during training. You can launch TensorBoard using following command.
tensorboard --logdir logdir