Giter Club home page Giter Club logo

densenet-tensorflow's Introduction

DenseNet-Tensorflow

An implementation of densenet in low level tensorflow API. Focus on performance, scalability and stability.

No tf.slim

No tf.layers

No tf.contrib

No opencv

Current graph is a variation of DenseNet-BC-121 with 224 input image size, the difference is that there's 52 convolutional layers in this implementation.

With this repo., you are able to train and test the architecture from scratch.

More sophisticated features are still under construction.

Feature

Support tfrecord

With minimum dependencies

Dependencies

numpy

Usage

  1. Clone the repo:
git clone https://github.com/yeephycho/densenet-tensorflow.git
  1. Download example tfrecord data: Click here to download. About how to generate tfrecord, please see repo. or see the script from tensorflow build image data.

Data comes from tensorflow inception retraining example which contains 5 kinds of flowers, click here to download original data.

  1. Train example data:
cd densenet-tensorflow
python train.py
  1. Visualize training loss:
tensorboard --logdir=./log
  1. Test model: A pre-trained model can be download here. Put the models folder under this project folder. Then
python test.py

Hopefully the pre-trained model should give you a precision of 80.3%.

Expected accuracy should be around 80%. Result

Reference

Densely Connected Convolutional Networks

densenet-tensorflow's People

Contributors

yeephycho avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar

densenet-tensorflow's Issues

combining shards into .tfrecord file?

I used python build_image_data.py for own data
"../build_image_data.py"
It creates shard files :
train-00000-of-00002
train-00001-of-00002

Now when I run ./train.py it cant find file train.tfrecord
ValueError: Failed to find file: ./own_data_dir/train.tfrecord
This seems to be hardcoded in data_provider.py (line 77) as:
filenames = [os.path.join(DATA_DIR, "train.tfrecord")]

How can I get the code to produce a file named "train.tfrecord" insteald of several separare files, 1 for each shard?

Or is there some other way to combine shard-files to single file named .tfrecord?

How to normalize the image for custom dataset

First of all, I would like to thank your code. It is very useful for me. I have used it and obtain 81% in the flower dataset.
Now, I will use it for my dataset which includes 10.000 png images in the range 0-255. I have two questions for making/training my dataset

  1. I saw in the build_image_data.py has png_to_jpeg(image_data), so if my dataset has png file, can it still work for converting tfrecord?
  2. Because my image range is from 0-255. I guess we must normalize it to 0-1 for input of densenet network. For that purpose, I think we will change after the line 56 in the data provider.py as
image_raw = tf.image.decode_jpeg(image_encoded, channels=3)
image_raw = tf.cast(image_raw , tf.float32) * (1. / 255)

Am I right?

do you have the imagenet pretrained model?

hello,is your pretrained model the imagenet pretrained model?If not, what's your pretrained dataset?I want to use denset to do place recognition , can I use your pretrained model?Thank you thank you ~~

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.