Coder Social home page Coder Social logo

tteepe / dcnv2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from matthewhowe/dcnv2

42.0 1.0 11.0 1.46 MB

Deformable Convolutional Networks v2 (DCNv2) with Pytorch 1.8+ & JIT Compilation

License: BSD 3-Clause "New" or "Revised" License

Python 29.62% Cuda 34.33% C 10.86% C++ 25.20%

dcnv2's Introduction

Archived: DCNv2

This repo has been archived! But there is a great maintained alternative by MMCV.

Use this guide to generate your install version, i.e.:

pip install mmcv-full==1.7.0 -f https://download.openmmlab.com/mmcv/dist/cu117/torch1.13/index.html

Then you can change your imports to replace your DCN layer:

from mmcv.ops.deform_conv import DeformConv2d as DCN

from mmcv.ops.modulated_deform_conv import ModulatedDeformConv2dPack as DCN

Old: DCNv2 with Pytorch 1.8+ & JIT Compilation

CI testing

Requirements

pip install torch torchvision torchaudio

sudo apt-get install ninja-build

Test

cd tests
python test_cuda.py  # run examples and gradient check on gpu
python test_cpu.py   # run examples and gradient check on cpu 

Note

Now the master branch is for pytorch 1.x, you can switch back to pytorch 0.4 with,

git checkout pytorch_0.4

Known Issues:

  • Gradient check w.r.t offset (solved)
  • Backward is not reentrant (minor)

This is an adaption of the official Deformable-ConvNets.

Update: all gradient check passes with double precision.

Another issue is that it raises RuntimeError: Backward is not reentrant. However, the error is very small (<1e-7 for float <1e-15 for double), so it may not be a serious problem (?)

Please post an issue or PR if you have any comments.

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.