Giter VIP home page Giter VIP logo

tensorflow-densenet's Introduction

Tensorflow-DenseNet with ImageNet Pretrained Models

This is an Tensorflow implementation of DenseNet by G. Huang, Z. Liu, K. Weinberger, and L. van der Maaten with ImageNet pretrained models. The weights are converted from DenseNet-Keras Models.

The code are largely borrowed from TensorFlow-Slim Models.

Pre-trained Models

The top-1/5 accuracy rates by using single center crop (crop size: 224x224, image size: 256xN)

Network Top-1 Top-5 Checkpoints
DenseNet 121 (k=32) 74.91 92.19 model
DenseNet 169 (k=32) 76.09 93.14 model
DenseNet 161 (k=48) 77.64 93.79 model

Usage

Follow the instruction TensorFlow-Slim Models.

Step-by-step Example of training on flowers dataset.

Downloading ans converting flowers dataset

$ DATA_DIR=/tmp/data/flowers
$ python download_and_convert_data.py \
    --dataset_name=flowers \
    --dataset_dir="${DATA_DIR}"

Training a model from scratch.

$ DATASET_DIR=/tmp/data/flowers
$ TRAIN_DIR=/tmp/train_logs
$ python train_image_classifier.py \
    --train_dir=${TRAIN_DIR} \
    --dataset_name=flowers \
    --dataset_split_name=train \
    --dataset_dir=${DATASET_DIR} \
    --model_name=densenet121 

Fine-tuning a model from an existing checkpoint

$ DATASET_DIR=/tmp/data/flowers
$ TRAIN_DIR=/tmp/train_logs
$ CHECKPOINT_PATH=/tmp/my_checkpoints/tf-densenet121.ckpt
$ python train_image_classifier.py \
    --train_dir=${TRAIN_DIR} \
    --dataset_name=flowers \
    --dataset_split_name=train \
    --dataset_dir=${DATASET_DIR} \
    --model_name=densenet121 \
    --checkpoint_path=${CHECKPOINT_PATH} \
    --checkpoint_exclude_scopes=global_step,densenet121/logits \
    --trainable_scopes=densenet121/logits

tensorflow-densenet's People

Contributors

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