Centernet: problems about building DCNv2 with pytorch 1.1

Created on 2 Jun 2019  路  11Comments  路  Source: xingyizhou/CenterNet

I fix build.py and build_double.py
from torch.utils.ffi import create_extension to from torch.utils.cpp_extension import BuildExtension
ffi = create_extension(...) to ffi = BuildExtension(...)
But a new problems occur:
TypeError: dist must be a Distribution instance
image

Most helpful comment

I got pose estimation working for pytorch 1.1.0 and wrote some of my steps, See if this applies to your use case.

environment.txt

Conda env

The working conda env is in the environment.txt file. Rename it to .yml if you want to install it with conda.

Get the code

First you'll want to do

git clone https://github.com/xingyizhou/CenterNet

We'll call the resulting folder CNROOT.

Next, go to the $CNROOT/src/lib/models/networks dir and delete the DCNv2 directory.

Stay in the $CNROOT/src/lib/models/networks and do

git clone https://github.com/CharlesShang/DCNv2

Folow the set up for that repo (run make.sh, etc.)

Go into $CNROOT/src/lib/models/networks/pose_dla_dcn.py and comment out lines 313 and 314 - these won't be missed:

if pretrained:
model.load_pretrained_model(data='imagenet', name='dla34', hash='ba72cf86')

Go into $CNROOT/src/lib/opts.py and in line 323 set
opt.flip_idx = False

Go back to the CNROOT and download this model into the models dir (create it if it doesn't exist)

Try to run the demo as described.

All 11 comments

@wangleihitcs hi, I have the same problem in pytorch 1.0. Did you solve it?

I got pose estimation working for pytorch 1.1.0 and wrote some of my steps, See if this applies to your use case.

environment.txt

Conda env

The working conda env is in the environment.txt file. Rename it to .yml if you want to install it with conda.

Get the code

First you'll want to do

git clone https://github.com/xingyizhou/CenterNet

We'll call the resulting folder CNROOT.

Next, go to the $CNROOT/src/lib/models/networks dir and delete the DCNv2 directory.

Stay in the $CNROOT/src/lib/models/networks and do

git clone https://github.com/CharlesShang/DCNv2

Folow the set up for that repo (run make.sh, etc.)

Go into $CNROOT/src/lib/models/networks/pose_dla_dcn.py and comment out lines 313 and 314 - these won't be missed:

if pretrained:
model.load_pretrained_model(data='imagenet', name='dla34', hash='ba72cf86')

Go into $CNROOT/src/lib/opts.py and in line 323 set
opt.flip_idx = False

Go back to the CNROOT and download this model into the models dir (create it if it doesn't exist)

Try to run the demo as described.

@wangleihitcs hi, I have the same problem in pytorch 1.0. Did you solve it?

The reason is that python setuptools version is dismatch with distutils version. Someone try update python version like 3.6 to 3,7. I don't try this锛孖 only turn pytorch from 1.0 to 0.4.

RuntimeError: cublas runtime error : the GPU program failed to execute at /pytorch/aten/src/THC/THCBlas.cu:425

got this error when running demo.py (i have compiled external and replaced DCNv2/ (and compiled it))

any idea how to fix it?

RuntimeError: cublas runtime error : the GPU program failed to execute at /pytorch/aten/src/THC/THCBlas.cu:425

got this error when running demo.py (i have compiled external and replaced DCNv2/ (and compiled it))

any idea how to fix it?

Have you cope with it?? My GPU RTX 2070s

I got pose estimation working for pytorch 1.1.0 and wrote some of my steps, See if this applies to your use case.

environment.txt

Conda env

The working conda env is in the environment.txt file. Rename it to .yml if you want to install it with conda.

Get the code

First you'll want to do

git clone https://github.com/xingyizhou/CenterNet

We'll call the resulting folder CNROOT.

Next, go to the $CNROOT/src/lib/models/networks dir and delete the DCNv2 directory.

Stay in the $CNROOT/src/lib/models/networks and do

git clone https://github.com/CharlesShang/DCNv2

Folow the set up for that repo (run make.sh, etc.)

Go into $CNROOT/src/lib/models/networks/pose_dla_dcn.py and comment out lines 313 and 314 - these won't be missed:

if pretrained:
model.load_pretrained_model(data='imagenet', name='dla34', hash='ba72cf86')

Go into $CNROOT/src/lib/opts.py and in line 323 set
opt.flip_idx = False

Go back to the CNROOT and download this model into the models dir (create it if it doesn't exist)

Try to run the demo as described.

Thanks! very help!

@

RuntimeError: cublas runtime error : the GPU program failed to execute at /pytorch/aten/src/THC/THCBlas.cu:425

got this error when running demo.py (i have compiled external and replaced DCNv2/ (and compiled it))

any idea how to fix it?

I meet same error, have you solved this problem? Thanks

@ArtyZe have you solved it?

@ArtyZe have you solved it?

https://github.com/jinfagang/DCNv2_latest
Use this one to replace dcnv2 in centernet

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lhyfst picture lhyfst  路  3Comments

bhack picture bhack  路  6Comments

ycxxn picture ycxxn  路  3Comments

leiyaohui picture leiyaohui  路  3Comments

mjanddy picture mjanddy  路  3Comments