CenterTrack icon indicating copy to clipboard operation
CenterTrack copied to clipboard

After compile DCNv2 successful, still can not import DCN

Open cs-heibao opened this issue 4 years ago • 30 comments

(CenterTrack) ccv@SYS-4029GP-TRT:/media/data/CenterTrack-master/src$ python demo.py tracking --load_model ../models/coco_tracking.pth --demo ../data/ --gpus 2 import DCN failed Import DCN failed import DCN failed import DCN failed /home/ccv/miniconda3/envs/CenterTrack/lib/python3.6/site-packages/sklearn/utils/linear_assignment_.py:22: FutureWarning: The linear_assignment_ module is deprecated in 0.21 and will be removed from 0.23. Use scipy.optimize.linear_sum_assignment instead. FutureWarning) Running tracking Using tracking threshold for out threshold! 0.3 Fix size testing. training chunk_sizes: [32] input h w: 512 512 heads {'hm': 80, 'reg': 2, 'wh': 2, 'tracking': 2} weights {'hm': 1, 'reg': 1, 'wh': 0.1, 'tracking': 1} head conv {'hm': [256], 'reg': [256], 'wh': [256], 'tracking': [256]} Creating model... Using node type: (<class 'model.networks.dla.DeformConv'>, <class 'model.networks.dla.DeformConv'>) Warning: No ImageNet pretrain!! Traceback (most recent call last): File "demo.py", line 118, in demo(opt) File "demo.py", line 23, in demo detector = Detector(opt) File "/media/ccv/data/CenterTrack-master/src/lib/detector.py", line 33, in init opt.arch, opt.heads, opt.head_conv, opt=opt) File "/media/ccv/data/CenterTrack-master/src/lib/model/model.py", line 28, in create_model model = model_class(num_layers, heads=head, head_convs=head_conv, opt=opt) File "/media/ccv/data/CenterTrack-master/src/lib/model/networks/dla.py", line 611, in init node_type=self.node_type) File "/media/ccv/data/CenterTrack-master/src/lib/model/networks/dla.py", line 564, in init node_type=node_type)) File "/media/ccv/data/CenterTrack-master/src/lib/model/networks/dla.py", line 526, in init proj = node_type[0](c, o) File "/media/ccv/data/CenterTrack-master/src/lib/model/networks/dla.py", line 513, in init self.conv = DCN(chi, cho, kernel_size=(3,3), stride=1, padding=1, dilation=1, deformable_groups=1) TypeError: 'NoneType' object is not callable

cs-heibao avatar May 07 '20 02:05 cs-heibao

i am also facing same problem , any solution ?

devendraswamy avatar May 07 '20 04:05 devendraswamy

@devendraswamy I have no ideas.

cs-heibao avatar May 07 '20 08:05 cs-heibao

I tried with torch =0.4.1 but no use

On Thu 7 May, 2020, 14:24 cs-heibao, [email protected] wrote:

@devendraswamy https://github.com/devendraswamy I have no ideas.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/xingyizhou/CenterTrack/issues/53#issuecomment-625122792, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALLD6LRLEBNJXOQ5FAGGW7LRQJZNBANCNFSM4M26NFJA .

devendraswamy avatar May 07 '20 09:05 devendraswamy

I've tried pytorch==1.0.0/1.4.0/1.3.1 and torchvision==0.4.2/0.2, also can not run.

cs-heibao avatar May 07 '20 09:05 cs-heibao

Could you try with torch==0.4.0 ? If not try with that one once.

On Thu 7 May, 2020, 15:18 cs-heibao, [email protected] wrote:

I've tried pytorch==1.0.0/1.4.0/1.3.1 and torchvision==0.4.2/0.2, also can not run.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/xingyizhou/CenterTrack/issues/53#issuecomment-625149431, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALLD6LUXUADYL4GYE6KCJMLRQJ7WBANCNFSM4M26NFJA .

devendraswamy avatar May 07 '20 09:05 devendraswamy

It should work with torch >= 1.0. Can you un-comment the try/ except in the import dcnvs line and see what's the error message?

xingyizhou avatar May 07 '20 17:05 xingyizhou

compile DCNv2 and add this to demo.py

import sys
sys.path.append("./lib/model/networks/DCNv2")

jishanshanss avatar May 08 '20 06:05 jishanshanss

It should work with torch >= 1.0. Can you un-comment the try/ except in the import dcnvs line and see what's the error message?

Here is the error message:

Traceback (most recent call last):
  File "demo.py", line 13, in <module>
    from detector import Detector
  File "/content/drive/My Drive/CenterTrack/src/lib/detector.py", line 13, in <module>
    from model.model import create_model, load_model
  File "/content/drive/My Drive/CenterTrack/src/lib/model/model.py", line 10, in <module>
    from .networks.dla import DLASeg
  File "/content/drive/My Drive/CenterTrack/src/lib/model/networks/dla.py", line 18, in <module>
    from .DCNv2.dcn_v2 import DCN
  File "/content/drive/My Drive/CenterTrack/src/lib/model/networks/DCNv2/dcn_v2.py", line 13, in <module>
    import _ext as _backend
ImportError: /content/drive/My Drive/CenterTrack/src/lib/model/networks/DCNv2/_ext.cpython-36m-x86_64-linux-gnu.so: undefined symbol: THPVariableClass

n-kasatkin avatar May 12 '20 15:05 n-kasatkin

It should work with torch >= 1.0. Can you un-comment the try/ except in the import dcnvs line and see what's the error message?

Here is the error message:


Traceback (most recent call last):

  File "demo.py", line 13, in <module>

    from detector import Detector

  File "/content/drive/My Drive/CenterTrack/src/lib/detector.py", line 13, in <module>

    from model.model import create_model, load_model

  File "/content/drive/My Drive/CenterTrack/src/lib/model/model.py", line 10, in <module>

    from .networks.dla import DLASeg

  File "/content/drive/My Drive/CenterTrack/src/lib/model/networks/dla.py", line 18, in <module>

    from .DCNv2.dcn_v2 import DCN

  File "/content/drive/My Drive/CenterTrack/src/lib/model/networks/DCNv2/dcn_v2.py", line 13, in <module>

    import _ext as _backend

ImportError: /content/drive/My Drive/CenterTrack/src/lib/model/networks/DCNv2/_ext.cpython-36m-x86_64-linux-gnu.so: undefined symbol: THPVariableClass

If you are on Colab have a look at this

https://github.com/xingyizhou/CenterTrack/issues/49#issuecomment-623953678

Muhtasham avatar May 12 '20 16:05 Muhtasham

compile DCNv2 and add this to demo.py

import sys
sys.path.append("./lib/model/networks/DCNv2")

tried but failed

sisrfeng avatar May 13 '20 02:05 sisrfeng

I try https://github.com/xingyizhou/CenterTrack/blob/master/readme/INSTALL.md again from step 2 ,then can import dcn

maybe this step did not succeed last time

cd $CenterTrack_ROOT/src/lib/model/networks/
# git clone https://github.com/CharlesShang/DCNv2/ # clone if it is not automatically downloaded by `--recursive`.
cd DCNv2
./make.sh

but now I met

The NVIDIA driver on your system is too old (found version 10010).
Please update your GPU driver by downloading and installing a new
version from the URL: http://www.nvidia.com/Download/index.aspx
Alternatively, go to: https://pytorch.org to install
a PyTorch version that has been compiled with your version
of the CUDA driver.
❯ python                                                                                               [04:17:17]
Python 3.6.6 |Anaconda, Inc.| (default, Jun 28 2018, 17:14:51) 
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> print(torch.__version__)
1.5.0

 ❯ conda uninstall pytorch                                                                              [03:56:28]
Solving environment: done

==> WARNING: A newer version of conda exists. <==
  current version: 4.4.10
  latest version: 4.8.3

Please update conda by running

    $ conda update -n base conda

## Package Plan ##

  environment location: /root/anaconda3

  removed specs: 
    - pytorch


The following packages will be REMOVED:

    pytorch:     1.0.0-py3.6_cuda10.0.130_cudnn7.4.1_1 pytorch [cuda100]
    torchvision: 0.2.1-py_2                            pytorch

sisrfeng avatar May 13 '20 04:05 sisrfeng

after conda uninstall pytorch,I install pytorch: conda install pytorch==1.0.0 torchvision==0.2.1 cuda100 -c pytorch Now :

import DCN failed
Import DCN failed
import DCN failed
import DCN failed
['/root/t/src/lib', '/root/t/src', '/root/anaconda3/lib/python36.zip', '/root/anaconda3/lib/python3.6', '/root/anaconda3/lib/python3.6/lib-dynload', '/root/anaconda3/lib/python3.6/site-packages', '/root/t/src/lib/model/networks/DCNv2', 'asdf']
Running tracking
Using tracking threshold for out threshold! 0.3
Fix size testing.
training chunk_sizes: [32]
input h w: 512 512
heads {'hm': 80, 'reg': 2, 'wh': 2, 'tracking': 2}
weights {'hm': 1, 'reg': 1, 'wh': 0.1, 'tracking': 1}
head conv {'hm': [256], 'reg': [256], 'wh': [256], 'tracking': [256]}
Creating model...
Using node type: (<class 'model.networks.dla.DeformConv'>, <class 'model.networks.dla.DeformConv'>)
Warning: No ImageNet pretrain!!
Traceback (most recent call last):
  File "demo.py", line 120, in <module>
    demo(opt)
  File "demo.py", line 25, in demo
    detector = Detector(opt)
  File "/root/t/src/lib/detector.py", line 33, in __init__
    opt.arch, opt.heads, opt.head_conv, opt=opt)
  File "/root/t/src/lib/model/model.py", line 28, in create_model
    model = model_class(num_layers, heads=head, head_convs=head_conv, opt=opt)
  File "/root/t/src/lib/model/networks/dla.py", line 611, in __init__
    node_type=self.node_type)
  File "/root/t/src/lib/model/networks/dla.py", line 564, in __init__
    node_type=node_type))
  File "/root/t/src/lib/model/networks/dla.py", line 526, in __init__
    proj = node_type[0](c, o)
  File "/root/t/src/lib/model/networks/dla.py", line 513, in __init__
    self.conv = DCN(chi, cho, kernel_size=(3,3), stride=1, padding=1, dilation=1, deformable_groups=1)
TypeError: 'NoneType' object is not callable
(base) 

sisrfeng avatar May 13 '20 05:05 sisrfeng

I tried with cuda 10.2 and pytorch 0.4, 1.0 but same error

On Wed 13 May, 2020, 10:44 Curiosity, [email protected] wrote:

after conda uninstall pytorch,I install pytorch: conda install pytorch==1.0.0 torchvision==0.2.1 cuda100 -c pytorch Now :

import DCN failed

Import DCN failed

import DCN failed

import DCN failed

['/root/t/src/lib', '/root/t/src', '/root/anaconda3/lib/python36.zip', '/root/anaconda3/lib/python3.6', '/root/anaconda3/lib/python3.6/lib-dynload', '/root/anaconda3/lib/python3.6/site-packages', '/root/t/src/lib/model/networks/DCNv2', 'asdf']

Running tracking

Using tracking threshold for out threshold! 0.3

Fix size testing.

training chunk_sizes: [32]

input h w: 512 512

heads {'hm': 80, 'reg': 2, 'wh': 2, 'tracking': 2}

weights {'hm': 1, 'reg': 1, 'wh': 0.1, 'tracking': 1}

head conv {'hm': [256], 'reg': [256], 'wh': [256], 'tracking': [256]}

Creating model...

Using node type: (<class 'model.networks.dla.DeformConv'>, <class 'model.networks.dla.DeformConv'>)

Warning: No ImageNet pretrain!!

Traceback (most recent call last):

File "demo.py", line 120, in

demo(opt)

File "demo.py", line 25, in demo

detector = Detector(opt)

File "/root/t/src/lib/detector.py", line 33, in init

opt.arch, opt.heads, opt.head_conv, opt=opt)

File "/root/t/src/lib/model/model.py", line 28, in create_model

model = model_class(num_layers, heads=head, head_convs=head_conv, opt=opt)

File "/root/t/src/lib/model/networks/dla.py", line 611, in init

node_type=self.node_type)

File "/root/t/src/lib/model/networks/dla.py", line 564, in init

node_type=node_type))

File "/root/t/src/lib/model/networks/dla.py", line 526, in init

proj = node_type[0](c, o)

File "/root/t/src/lib/model/networks/dla.py", line 513, in init

self.conv = DCN(chi, cho, kernel_size=(3,3), stride=1, padding=1, dilation=1, deformable_groups=1)

TypeError: 'NoneType' object is not callable

(base)

✘ ⚡ root@c8078b8b9e17  ~/t/src   master ⁝ ✱ 

❯ python demo.py tracking --load_model ../models/coco_tracking.pth --demo ~/d/aic/AIC20_track3/train/S01/c001/vdo.avi

import DCN failed

Import DCN failed

import DCN failed

import DCN failed

['/root/t/src/lib', '/root/t/src', '/root/anaconda3/lib/python36.zip', '/root/anaconda3/lib/python3.6', '/root/anaconda3/lib/python3.6/lib-dynload', '/root/anaconda3/lib/python3.6/site-packages', '/root/t/src/lib/model/networks/DCNv2']

Running tracking

Using tracking threshold for out threshold! 0.3

Fix size testing.

training chunk_sizes: [32]

input h w: 512 512

heads {'hm': 80, 'reg': 2, 'wh': 2, 'tracking': 2}

weights {'hm': 1, 'reg': 1, 'wh': 0.1, 'tracking': 1}

head conv {'hm': [256], 'reg': [256], 'wh': [256], 'tracking': [256]}

Creating model...

Using node type: (<class 'model.networks.dla.DeformConv'>, <class 'model.networks.dla.DeformConv'>)

Warning: No ImageNet pretrain!!

Traceback (most recent call last):

File "demo.py", line 120, in

demo(opt)

File "demo.py", line 25, in demo

detector = Detector(opt)

File "/root/t/src/lib/detector.py", line 33, in init

opt.arch, opt.heads, opt.head_conv, opt=opt)

File "/root/t/src/lib/model/model.py", line 28, in create_model

model = model_class(num_layers, heads=head, head_convs=head_conv, opt=opt)

File "/root/t/src/lib/model/networks/dla.py", line 611, in init

node_type=self.node_type)

File "/root/t/src/lib/model/networks/dla.py", line 564, in init

node_type=node_type))

File "/root/t/src/lib/model/networks/dla.py", line 526, in init

proj = node_type[0](c, o)

File "/root/t/src/lib/model/networks/dla.py", line 513, in init

self.conv = DCN(chi, cho, kernel_size=(3,3), stride=1, padding=1, dilation=1, deformable_groups=1)

TypeError: 'NoneType' object is not callable

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/xingyizhou/CenterTrack/issues/53#issuecomment-627750640, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALLD6LQZPX45PJNQCOEQOLLRRIUEBANCNFSM4M26NFJA .

devendraswamy avatar May 13 '20 05:05 devendraswamy

It should work with torch >= 1.0. Can you un-comment the try/ except in the import dcnvs line and see what's the error message?

You mean here? https://github.com/xingyizhou/CenterTrack/blob/04fe46ca61f2b029249c33516241028b0dfb0b6f/src/lib/model/networks/dla.py#L18 but it has already been un-commented by you.

sisrfeng avatar May 15 '20 01:05 sisrfeng

ghost avatar May 20 '20 22:05 ghost

Cannot understand why there are so many installation errors. Did the authors try their posted instructions? We are exactly following your posted instructions, while so many compatible errors coming. It really wastes a lot of time.

After installing pytorch 1.4, I can run demo.py successfully.

sisrfeng avatar May 21 '20 05:05 sisrfeng

I have installed pytorch 1.4 I can not run demo.py what is wrong ? my conda environment is : _libgcc_mutex 0.1 main defaults _pytorch_select 0.2 gpu_0 defaults attrs 19.3.0 backcall 0.2.0 blas 1.0 mkl defaults bleach 3.1.5 ca-certificates 2020.1.1 0 defaults cachetools 4.1.0 certifi 2020.4.5.1 py36_0 defaults cffi 1.14.0 py36he30daa8_1 defaults cudatoolkit 10.0.130 0 defaults cudnn 7.6.5 cuda10.0_0 defaults cycler 0.10.0 Cython 0.29.1 decorator 4.4.2 defusedxml 0.6.0 descartes 1.1.0 easydict 1.9 entrypoints 0.3 flake8 3.8.3 flake8-import-order 0.18.1 freetype 2.9.1 h8a8886c_1 defaults importlib-metadata 1.6.1 intel-openmp 2020.1 217 defaults ipykernel 5.3.0 ipython 7.15.0 ipython-genutils 0.2.0 ipywidgets 7.5.1 jedi 0.17.0 Jinja2 2.11.2 joblib 0.15.1 jpeg 9b h024ee3a_2 defaults jsonschema 3.2.0 jupyter 1.0.0 jupyter-client 6.1.3 jupyter-console 6.1.0 jupyter-core 4.6.3 kiwisolver 1.2.0 ld_impl_linux-64 2.33.1 h53a641e_7 defaults libedit 3.1.20181209 hc058e9b_0 defaults libffi 3.3 he6710b0_1 defaults libgcc-ng 9.1.0 hdf63c60_0 defaults libgfortran-ng 7.3.0 hdf63c60_0 defaults libpng 1.6.37 hbc83047_0 defaults libstdcxx-ng 9.1.0 hdf63c60_0 defaults libtiff 4.1.0 h2733197_1 defaults llvmlite 0.32.1 lz4-c 1.9.2 he6710b0_0 defaults MarkupSafe 1.1.1 matplotlib 3.2.0 mccabe 0.6.1 mistune 0.8.4 mkl 2020.1 217 defaults mkl-service 2.3.0 py36he904b0f_0 defaults mkl_fft 1.0.15 py36ha843d7b_0 defaults mkl_random 1.1.1 py36h0573a6f_0 defaults more-itertools 8.3.0 motmetrics 1.2.0 nbconvert 5.6.1 nbformat 5.0.7 ncurses 6.2 he6710b0_1 defaults ninja 1.9.0 py36hfd86e86_0 defaults notebook 6.0.3 numba 0.49.1 numpy 1.18.1 py36h4f9e942_0 defaults numpy-base 1.18.1 py36hde5b4d6_1 defaults nuscenes-devkit 1.0.3 olefile 0.46 py_0 defaults opencv-python 3.4.1.15 openssl 1.1.1g h7b6447c_0 defaults packaging 20.4 pandas 1.0.4 pandocfilters 1.4.2 parso 0.7.0 pexpect 4.8.0 pickleshare 0.7.5 pillow 7.1.2 py36hb39fc2d_0 defaults pip 20.0.2 py36_3 defaults pluggy 0.13.1 progress 1.5 prometheus-client 0.8.0 prompt-toolkit 3.0.5 ptyprocess 0.6.0 py 1.8.1 py-cpuinfo 5.0.0 pycocotools 2.0 pycodestyle 2.6.0 pycparser 2.20 py_0 defaults pyflakes 2.2.0 Pygments 2.6.1 pyparsing 2.4.7 pyquaternion 0.9.5 pyrsistent 0.16.0 pytest 5.4.3 pytest-benchmark 3.2.3 python 3.6.10 h7579374_2 defaults python-dateutil 2.8.1 pytorch 1.4.0 py3.6_cuda10.0.130_cudnn7.6.3_0 file:///home/yin/下载 pytz 2020.1 PyYAML 5.3.1 pyzmq 19.0.1 qtconsole 4.7.4 QtPy 1.9.0 readline 8.0 h7b6447c_0 defaults scikit-learn 0.22.2 scipy 1.4.1 Send2Trash 1.5.0 setuptools 47.1.1 py36_0 defaults Shapely 1.7.0 six 1.15.0 py_0 defaults sqlite 3.31.1 h62c20be_1 defaults terminado 0.8.3 testpath 0.4.4 threadpoolctl 2.1.0 tk 8.6.8 hbc83047_0 defaults torchvision 0.5.0 py36_cu100 file:///home/yin/下载 tornado 6.0.4 tqdm 4.19.9 traitlets 4.3.3 wcwidth 0.2.4 webencodings 0.5.1 wheel 0.34.2 py36_0 defaults widgetsnbextension 3.5.1 xmltodict 0.12.0 xz 5.2.5 h7b6447c_0 defaults zipp 3.1.0 zlib 1.2.11 h7b6447c_3 defaults zstd 1.4.4 h0b5b093_3 defaults

(CenterTrack) yin@hai:~/CenterTrack/src$ python demo.py tracking,ddd --load_model ../models/nuScenes_3Dtracking.pth --dataset nuscenes --pre_hm --track_thresh 0.1 --demo ../videos/nuscenes_mini.mp4 --test_focal_length 633 import DCN failed Import DCN failed import DCN failed import DCN failed /home/yin/anaconda3/envs/CenterTrack/lib/python3.6/site-packages/sklearn/utils/linear_assignment_.py:22: FutureWarning: The linear_assignment_ module is deprecated in 0.21 and will be removed from 0.23. Use scipy.optimize.linear_sum_assignment instead. FutureWarning) Running tracking Using tracking threshold for out threshold! 0.1 Fix size testing. training chunk_sizes: [32] input h w: 448 800 heads {'hm': 10, 'reg': 2, 'wh': 2, 'tracking': 2, 'dep': 1, 'rot': 8, 'dim': 3, 'amodel_offset': 2} weights {'hm': 1, 'reg': 1, 'wh': 0.1, 'tracking': 1, 'dep': 1, 'rot': 1, 'dim': 1, 'amodel_offset': 1} head conv {'hm': [256], 'reg': [256], 'wh': [256], 'tracking': [256], 'dep': [256], 'rot': [256], 'dim': [256], 'amodel_offset': [256]} Creating model... Using node type: (<class 'model.networks.dla.DeformConv'>, <class 'model.networks.dla.DeformConv'>) Warning: No ImageNet pretrain!! Traceback (most recent call last): File "demo.py", line 128, in demo(opt) File "demo.py", line 26, in demo detector = Detector(opt) File "/home/yin/CenterTrack/src/lib/detector.py", line 33, in init opt.arch, opt.heads, opt.head_conv, opt=opt) File "/home/yin/CenterTrack/src/lib/model/model.py", line 28, in create_model model = model_class(num_layers, heads=head, head_convs=head_conv, opt=opt) File "/home/yin/CenterTrack/src/lib/model/networks/dla.py", line 611, in init node_type=self.node_type) File "/home/yin/CenterTrack/src/lib/model/networks/dla.py", line 564, in init node_type=node_type)) File "/home/yin/CenterTrack/src/lib/model/networks/dla.py", line 526, in init proj = node_type[0](c, o) File "/home/yin/CenterTrack/src/lib/model/networks/dla.py", line 513, in init self.conv = DCN(chi, cho, kernel_size=(3,3), stride=1, padding=1, dilation=1, deformable_groups=1) TypeError: 'NoneType' object is not callable

yinhai86924 avatar Jun 11 '20 15:06 yinhai86924

Check the directory where you cloned DCN and make sure it is in $CenterTrack_ROOT/src/lib/model/networks/

YoushaaMurhij avatar Jun 29 '20 17:06 YoushaaMurhij

compile DCNv2 and add this to demo.py

import sys
sys.path.append("./lib/model/networks/DCNv2")

This worked

Rajasekhar06 avatar Aug 14 '20 06:08 Rajasekhar06

i met the same problem i re_compile it ,it worked

liuxufenfeiya avatar Sep 08 '20 11:09 liuxufenfeiya

so terrible README ,I'm confused about which version of these modules on earth!

ZZM37 avatar Sep 16 '20 02:09 ZZM37

@cs-heibao I think I sovled this problem. I tried on pytorch=1.4 torchvision=0.5.0 cudatoolkit=10.1 CUDA=10.2. I also met the same problem. If you reinstall your pytorch, torchvision,cudatoolkit or CUDA, you must compile DCNv2 again like your first action. And the problem may be solved! The results is shown below. image

JOSHUAWENJZ avatar Nov 23 '20 01:11 JOSHUAWENJZ

I encountered all the above problems and tried all the methods. After analysis, the torch version of the compiled DCNv2 must be the same as the torch version finally used before it can run. I re-used torch==1.4.0+cu100 and deleted the build folder of DCNv2 and recompiled DCNv2.Finnally,it works. image

WesLee88524 avatar Dec 02 '20 05:12 WesLee88524

You should have successfully compiled DCNv2 on the CPU, but failed to compile it on the GPU. If you build Docker container according to this pull request https://github.com/xingyizhou/CenterTrack/pull/176, you don't need to recompile DCNv2.

Keiku avatar Dec 23 '20 08:12 Keiku

After compiling DCNv2, change all: from .DCNv2.dcn_v2 import DCN, to: from dcn_v2 import DCN

nidetaoge avatar Jun 10 '21 03:06 nidetaoge

Remove previous python, and remove installed DCNv2, then installed your required python version

Clone python version compatible DCNv2 and build it. Worked for me. Could worked for you as well.

git clone https://github.com/lbin/DCNv2 -b pytorch_1.5 cd DCNv2 ./make.sh

prabhuiitdhn avatar Aug 17 '21 14:08 prabhuiitdhn

(CenterTrack) ccv@SYS-4029GP-TRT:/media/data/CenterTrack-master/src$ python demo.py tracking --load_model ../models/coco_tracking.pth --demo ../data/ --gpus 2 import DCN failed Import DCN failed import DCN failed import DCN failed /home/ccv/miniconda3/envs/CenterTrack/lib/python3.6/site-packages/sklearn/utils/linear_assignment_.py:22: FutureWarning: The linear_assignment_ module is deprecated in 0.21 and will be removed from 0.23. Use scipy.optimize.linear_sum_assignment instead. FutureWarning) Running tracking Using tracking threshold for out threshold! 0.3 Fix size testing. training chunk_sizes: [32] input h w: 512 512 heads {'hm': 80, 'reg': 2, 'wh': 2, 'tracking': 2} weights {'hm': 1, 'reg': 1, 'wh': 0.1, 'tracking': 1} head conv {'hm': [256], 'reg': [256], 'wh': [256], 'tracking': [256]} Creating model... Using node type: (<class 'model.networks.dla.DeformConv'>, <class 'model.networks.dla.DeformConv'>) Warning: No ImageNet pretrain!! Traceback (most recent call last): File "demo.py", line 118, in demo(opt) File "demo.py", line 23, in demo detector = Detector(opt) File "/media/ccv/data/CenterTrack-master/src/lib/detector.py", line 33, in init opt.arch, opt.heads, opt.head_conv, opt=opt) File "/media/ccv/data/CenterTrack-master/src/lib/model/model.py", line 28, in create_model model = model_class(num_layers, heads=head, head_convs=head_conv, opt=opt) File "/media/ccv/data/CenterTrack-master/src/lib/model/networks/dla.py", line 611, in init node_type=self.node_type) File "/media/ccv/data/CenterTrack-master/src/lib/model/networks/dla.py", line 564, in init node_type=node_type)) File "/media/ccv/data/CenterTrack-master/src/lib/model/networks/dla.py", line 526, in init proj = node_type[0](c, o) File "/media/ccv/data/CenterTrack-master/src/lib/model/networks/dla.py", line 513, in init self.conv = DCN(chi, cho, kernel_size=(3,3), stride=1, padding=1, dilation=1, deformable_groups=1) TypeError: 'NoneType' object is not callable

I had the same error. I first thought I compiled DCNv2 correctly and in my case it was not. so I ran python setup.py build develop command manually inside my DCNv2 folder and it compiled DCNv2 successfully. It solved the problem and I got rid of the error. hope this helps.

akhilasuraj avatar Aug 23 '21 18:08 akhilasuraj

From my experience, you shold import DCNv2 package under certain folder which named "DCNv2";

zengjie617789 avatar Jan 18 '22 06:01 zengjie617789

cd $CenterTrack_ROOT/src/lib/model/networks/

git clone https://github.com/CharlesShang/DCNv2/ # clone if it is not automatically downloaded by --recursive.

cd DCNv2 ./make.sh

=>>>>>> RuntimeError: Error compiling objects for extension

shuyu888 avatar Jun 08 '22 09:06 shuyu888

@cs-heibao I think I sovled this problem. I tried on pytorch=1.4 torchvision=0.5.0 cudatoolkit=10.1 CUDA=10.2. I also met the same problem. If you reinstall your pytorch, torchvision,cudatoolkit or CUDA, you must compile DCNv2 again like your first action. And the problem may be solved! The results is shown below. image

Do you need change pytorch version when compile DCNv2? which means use 2 different package lists

LinaZhangUSC avatar Jun 05 '23 23:06 LinaZhangUSC