CenterTrack
CenterTrack copied to clipboard
After compile DCNv2 successful, still can not import DCN
(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
i am also facing same problem , any solution ?
@devendraswamy I have no ideas.
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 .
I've tried pytorch==1.0.0/1.4.0/1.3.1 and torchvision==0.4.2/0.2, also can not run.
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 .
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?
compile DCNv2 and add this to demo.py
import sys
sys.path.append("./lib/model/networks/DCNv2")
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
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
compile DCNv2 and add this to demo.py
import sys sys.path.append("./lib/model/networks/DCNv2")
tried but failed
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
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)
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 .
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.
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.
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
(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
Check the directory where you cloned DCN and make sure it is in $CenterTrack_ROOT/src/lib/model/networks/
compile DCNv2 and add this to demo.py
import sys sys.path.append("./lib/model/networks/DCNv2")
This worked
i met the same problem i re_compile it ,it worked
so terrible README ,I'm confused about which version of these modules on earth!
@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.
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.
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.
After compiling DCNv2, change all: from .DCNv2.dcn_v2 import DCN, to: from dcn_v2 import DCN
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
(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.
From my experience, you shold import DCNv2 package under certain folder which named "DCNv2";
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
@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.
Do you need change pytorch version when compile DCNv2? which means use 2 different package lists