项目作者: dkorobchenko-nv
项目描述 :
Transfer Learning: Training a food image classifier using pretrained weights with TensorFlow
高级语言: Python
项目地址: git://github.com/dkorobchenko-nv/transfer-learning-food.git
Transfer Learning Example
This demo shows how to train a ConvNet on your own data using pretrained weights.
In the example we will train an image classifier to recognize food.
The demo is implemented using TensorFlow 1.10
Main components
- Model definition
- In the demo we will use VGG19 model
- The model is defined in
model.py
using TensorFlow Slim
- Training pipeline
- The pipeline contains train/val dataset pipelines, train/val graphs definition, train loss, validation accuracy, loading of pretrained weights from a snapshot, various TF training structures and training loop
- The procedure is defined in
train.py
- To run the training use
train.py
or run_train.sh
- Check “Settings” section in both files before running
- Inference pipeline
- The pipeline contains inference graph definition, loading trained weights, loading and preprocessing an input test image and inference procedure
- To run the inference use
inference.py
- Check “Settings” section before running
- Pretrained weights
- Dataset
Docker
To avoid problems with various versions of the frameworks, it is recommended to execute everything in a docker container.
- To build the docker container execute
./docker/docker_build.sh
- To run the docker container in bash mode execute
./docker/docker_run_bash.sh