CenterTrack
CenterTrack copied to clipboard
i have the DCNv2,but it's always error
(CenterTrack) I:\uc\CenterTrack-master\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
E:\Anaconda3\envs\CenterTrack\lib\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
(CenterTrack) I:\uc\CenterTrack-master\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
E:\Anaconda3\envs\CenterTrack\lib\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
(CenterTrack) I:\uc\CenterTrack-master\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
E:\Anaconda3\envs\CenterTrack\lib\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
(CenterTrack) I:\uc\CenterTrack-master\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 i
I solved it but can u tell me which Pytorch version you're using. In case with this error messages, I presume that you're not using Charles Shang's DCNv2 and you've successfully compiled the DCNv2, right?
The solution is simple since Matthew's DCNv2 has nested. You have to modified the backbone python like dla.py Go to $CenterTrack_Root/src/lib/model/network/ just add few lines of code to fix it:
import sys
sys.path.append("path/to/center-tracker/CenterTrack/src/lib/model/networks/DCNv2")
try:
from .DCNv2.DCN.dcn_v2 import DCN
except:
print('import DCN failed')
DCN = None
Hi @yktangac , i guess the only lines to add are:
import sys
sys.path.append("path/to/center-tracker/CenterTrack/src/lib/model/networks/DCNv2")
correct?
Anyway, i tried it and it did not solve the problem for me.
Hi @wangyunlong1111. I also faced this problem with Python 3.6. When I shifted to Python 3.8, the error got resolved after incorporating @yktangac's solution
Hi @yktangac , i guess the only lines to add are:
import sys sys.path.append("path/to/center-tracker/CenterTrack/src/lib/model/networks/DCNv2")
correct?
Anyway, i tried it and it did not solve the problem for me.
Well, you don't actually need that line: sys.path.append("path/to/center-tracker/CenterTrack/src/lib/model/networks/DCNv2") .
What I modified are in dla.py, dlaup.py, msraup.py, and resdcn.py
Matthew's DNCv2 is compatible with Pytorch versions from 1.6-1.8. If you install this DCNv2, just do the following in the above mentioned python files.
import sys
try:
#from .DCNv2.DCN.dcn_v2 import DCN <--- this is for Charles Shang's DCNv2
from DCN.dcn_v2 import DCN <--- if you're using Pytorch 1.6+
except:
print('import DCN failed')
DCN = None
Hope it helps!
Hi @yktangac ,
Hi @yktangac , i guess the only lines to add are:
import sys sys.path.append("path/to/center-tracker/CenterTrack/src/lib/model/networks/DCNv2")
correct? Anyway, i tried it and it did not solve the problem for me.
Well, you don't actually need that
line: sys.path.append("path/to/center-tracker/CenterTrack/src/lib/model/networks/DCNv2") .
What I modified are in dla.py, dlaup.py, msraup.py, and resdcn.pyMatthew's DNCv2 is compatible with Pytorch versions from 1.6-1.8. If you install this DCNv2, just do the following in the above mentioned python files.
import sys try: #from .DCNv2.DCN.dcn_v2 import DCN <--- this is for Charles Shang's DCNv2 from DCN.dcn_v2 import DCN <--- if you're using Pytorch 1.6+ except: print('import DCN failed') DCN = None
Hope it helps!
This helped to solve the issue. Thank you!
Using DCNv2_newest instead of given DCNv2 worked for me. You don't need to change any codes in CenterTrack with this way.
-
cd CenterTrack/src/lib/model/networks/
-
git clone https://codechina.csdn.net/mirrors/jinfagang/DCNv2_latest.git
-
cd DCNv2_latest
-
vim make.sh
- remove
sudo
to prevent install out of current environment. -
sudo python3 setup.py build develop
->python3 setup.py build develop
- remove
-
./make.sh
@philgineer
Using DCNv2_newest instead of given DCNv2 worked for me. You don't need to change any codes in CenterTrack with this way.
cd CenterTrack/src/lib/model/networks/
git clone https://codechina.csdn.net/mirrors/jinfagang/DCNv2_latest.git
cd DCNv2_latest
vim make.sh
- remove
sudo
to prevent install out of current environment.sudo python3 setup.py build develop
->python3 setup.py build develop
./make.sh
thanks!!!
I used the torch1.10.1, so I choose the version of CDNv2 is torch1.9,and I have the same issue .
like this
import DCN failed
Import DCN failed
import DCN failed
import DCN failed
Running tracking
Using tracking threshold for out threshold! 0.3
Fix size testing.
training chunk_sizes: [16, 16]
input h w: 544 960
heads {'hm': 1, 'reg': 2, 'wh': 2, 'tracking': 2, 'ltrb_amodal': 4}
weights {'hm': 1, 'reg': 1, 'wh': 0.1, 'tracking': 1, 'ltrb_amodal': 0.1}
head conv {'hm': [256], 'reg': [256], 'wh': [256], 'tracking': [256], 'ltrb_amodal': [256]}
Namespace(K=100, add_05=False, amodel_offset_weight=1, arch='dla_34', aug_rot=0, backbone='dla34', batch_size=32, chunk_sizes=[16, 16], custom_dataset_ann_path='../data/mot17/annotations/train_half.json', custom_dataset_img_path='../data/mot17/train/', data_dir='/data/xiaoyuting/CenterTrack/src/lib/../../data', dataset='custom', dataset_version='', debug=0, debug_dir='/data/xiaoyuting/CenterTrack/src/lib/../../exp/tracking/mot17_half_sc/debug', debugger_theme='white', demo='', dense_reg=1, dep_weight=1, depth_scale=1, dim_weight=1, dla_node='dcn', down_ratio=4, efficient_level=0, eval_val=False, exp_dir='/data/xiaoyuting/CenterTrack/src/lib/../../exp/tracking', exp_id='mot17_half_sc', fix_res=True, fix_short=-1, flip=0.5, flip_test=False, fp_disturb=0.1, gpus=[0, 1], gpus_str='0,1', head_conv={'hm': [256], 'reg': [256], 'wh': [256], 'tracking': [256], 'ltrb_amodal': [256]}, head_kernel=3, heads={'hm': 1, 'reg': 2, 'wh': 2, 'tracking': 2, 'ltrb_amodal': 4}, hm_disturb=0.05, hm_hp_weight=1, hm_weight=1, hp_weight=1, hungarian=False, ignore_loaded_cats=[], input_h=544, input_res=960, input_w=960, keep_res=False, kitti_split='3dop', load_model='', load_results='', lost_disturb=0.4, lr=0.000125, lr_step=[60], ltrb=False, ltrb_amodal=True, ltrb_amodal_weight=0.1, ltrb_weight=0.1, map_argoverse_id=False, master_batch_size=16, max_age=-1, max_frame_dist=3, model_output_list=False, msra_outchannel=256, neck='dlaup', new_thresh=0.3, nms=False, no_color_aug=False, no_pause=False, no_pre_img=False, non_block_test=False, not_cuda_benchmark=False, not_idaup=False, not_max_crop=False, not_prefetch_test=False, not_rand_crop=False, not_set_cuda_env=False, not_show_bbox=False, not_show_number=False, not_show_txt=False, num_classes=1, num_epochs=70, num_head_conv=1, num_iters=-1, num_layers=101, num_stacks=1, num_workers=4, nuscenes_att=False, nuscenes_att_weight=1, off_weight=1, only_show_dots=False, optim='adam', out_thresh=0.3, output_h=136, output_res=240, output_w=240, pad=31, pre_hm=True, pre_img=True, pre_thresh=0.3, print_iter=0, prior_bias=-4.6, public_det=False, qualitative=False, reg_loss='l1', reset_hm=False, resize_video=False, resume=False, reuse_hm=False, root_dir='/data/xiaoyuting/CenterTrack/src/lib/../..', rot_weight=1, rotate=0, same_aug_pre=True, save_all=False, save_dir='/data/xiaoyuting/CenterTrack/src/lib/../../exp/tracking/mot17_half_sc', save_framerate=30, save_img_suffix='', save_imgs=[], save_point=[90], save_results=False, save_video=False, scale=0, seed=317, shift=0, show_trace=False, show_track_color=False, skip_first=-1, tango_color=False, task='tracking', test=False, test_dataset='custom', test_focal_length=-1, test_scales=[1.0], track_thresh=0.3, tracking=True, tracking_weight=1, trainval=False, transpose_video=False, use_kpt_center=False, use_loaded_results=False, val_intervals=10000, velocity=False, velocity_weight=1, video_h=512, video_w=512, vis_gt_bev='', vis_thresh=0.3, weights={'hm': 1, 'reg': 1, 'wh': 0.1, 'tracking': 1, 'ltrb_amodal': 0.1}, wh_weight=0.1, zero_pre_hm=False, zero_tracking=False)
fatal: not a git repository (or any of the parent directories): .git
Traceback (most recent call last):
File "main.py", line 101, in
RuntimeError: Error compiling objects for extension
Try using Docker: https://github.com/bryanbocao/CenterTrack/blob/master/readme/Docker.md https://github.com/xingyizhou/CenterTrack/pull/290
Run CenterTrack using Docker
DCNv2 Compilation Issue Fixed
docker pull bryanbocao/centertrack
docker run -d --ipc=host --shm-size=16384m -it -v /:/share --gpus all --network=bridge bryanbocao/centertrack /bin/bash
docker ps -a
Check <CONTAINER_ID>
:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
89bb79551ccb bryanbocao/centertrack "/usr/local/bin/nvid…" 49 seconds ago Up 38 seconds 6006/tcp, 8888/tcp competent_northcutt
docker exec -it <CONTAINE_ID> /bin/bash
docker exec -it 89bb79551ccb /bin/bash
Inside the container:
cd /root/CenterTrack/src/lib/model/networks/DCNv2
python3 setup.py build develop
cd /root/CenterTrack/src/
python3 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
The DCNv2 is built from MatthewHowe_DCNv2. Thanks MatthewHowe for the contribution. Then you should be able to see the results.
Go to /share
to transfer data between the container and your root system.