Code Monkey home page Code Monkey logo

dilated-convolutional-layer-implementation's Introduction

An Implementation of Dilated Convolutional Layer Based on Darknet Architecture

This implementation of dilated convolutional layer was accomplished during my internship in Zerotech Inc., Beijing. The need for dilated convolutional layer comes from training CSRNet for crowd detection.

About Darknet

Darknet is an open source neural network framework written in C and CUDA by Joseph Redmon. It is fast, easy to install, and supports CPU and GPU computation. For more information please refer to the Darknet project website.

Darknet Dependency

Darknet has only two dependencies, and they are optional:

* OpenCV - for video I/O and more image types support
* CUDA - for GPU acceleration

This dilated convolutional layer implementation on GPU was written with CUDA Toolkit 9.0

Darknet Installation

The Makefile is provided in the main folder, to install Darknet with dilated convolutional layer, type:

make

Dilated Convolutional Layer

The added layer was tested by comparing with the output of Caffe's implementation of dilated conv layer, and it was also tested by the training of CSRNet composed of it.

Configuring the Dilated Convolutional Layer

Darknet uses .cfg file as the configuration of Neural Network. In the .cfg file, the dilated convolutional layer is configured with:

[dilated_convolutional]
batch_normalize=1
filters=64
size=3
stride=1
pad=1
activation=leaky
dilate_rate=1

Here's a demonstration of dilated convolution and dilate rate: window Dilated convolution expands its convolutional kernel according to dilate rate. In this demonstration, dilate rate = 1. If dilate rate = 0, dilated convolution is simply normal convolution.

CSRNet composed with this implementation training result

window window

Yolov3-tiny with dilated conv layer trained from scratch

window

This configuration file is included in ./cfg/yolo-d-tiny.cfg

dilated-convolutional-layer-implementation's People

Contributors

zzzdavid 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

Watchers

 avatar  avatar  avatar  avatar

dilated-convolutional-layer-implementation's Issues

CUDA Error: invalid configuration argument

[train op]
{
net info.
}
Loading weights from darknet53.conv.74...Done!
Learning Rate: 0.001, Momentum: 0.9, Decay: 0.0005
Resizing
384
192 192, 194 194
CUDA Error: invalid configuration argument
darknet: ./src/cuda.c:36: check_error: Assertion `0' failed.
Aborted (core dumped)

If i set random=0 in *.cfg ,there is no such error.
If i set random=1 in *.cfg, appear above error message.

Floating point exception (core dumped)

I meet this problem,when i train my own dataset.This is log information.
[
.....network inforamtion......
]
Loading weights from darknet53.conv.74...Done!
Learning Rate: 0.01, Momentum: 0.9, Decay: 0.0005
Resizing
320
160 160, 162 162
0 0, 83 83
1 1, 83 83
0 0, 1 1
44 44, 1 1
Loaded: 0.023670 seconds
Floating point exception (core dumped)
I hope you can answer my question,Thanks.

a problem about im2col_dilated.c

Hi, David,

I don’t understand the dilate_ksize calculation in your im2col_dilated.c program. Does dilated_ksize mean the size of the expanded convolution kernel? Looking forward to your reply!

Best regard,
xiaojun

yolov3-tiny-d.cfg

hi,how to use Dilated-Convolutional in the yolov3-voc.cfg, the demo you given is same as the old.
thanks

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.