Open chexiaoyu opened 3 years ago
I just fix the bug.Modify rpn_util.py #1444 1445 1446
anchors = torch.from_numpy(rpn_conf.anchors).cuda().float()
bbox_means = torch.from_numpy(rpn_conf.bbox_means).cuda().float()
bbox_stds = torch.from_numpy(rpn_conf.bbox_stds).cuda().float()
Moreover, #1516 sorted_inds = (-aboxes[:, 4]).argsort()
, tensor doesn't support argsort()
, should use torch.sort()
.
In the end, how to use multi-gpu to train?
Thanks for your contribution to fixing the bug. I haven't tested multi-gpu training, you can modify the code to support this feature.
I just fix the bug.Modify rpn_util.py #1444 1445 1446
anchors = torch.from_numpy(rpn_conf.anchors).cuda().float() bbox_means = torch.from_numpy(rpn_conf.bbox_means).cuda().float() bbox_stds = torch.from_numpy(rpn_conf.bbox_stds).cuda().float()
Moreover, #1516
sorted_inds = (-aboxes[:, 4]).argsort()
, tensor doesn't supportargsort()
, should usetorch.sort()
. In the end, how to use multi-gpu to train?
Hi! To train with multi-gpu, you should modify the code at lib/core/init_training_model to as fllow:
if 'CUDA_VISIBLE_DEVICES' not in os.environ.keys():
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
device_ids = [id for id in range(len(os.environ['CUDA_VISIBLE_DEVICES'].split(',')))]
network = torch.nn.DataParallel(network, device_ids)
network.to('cuda')
Then use CUDA_VISIBLE_DEVICES='your gpu device ids' python scripts/train_rpn_3d.py --config=config --exp_name=exp_name
to train with multi-gpu
Thanks for your research! When I run
python scripts/train_rpn_3d.py --config=kitti_3d_base --exp_name base
, training is normal, but a bug appear in testing. My torch version is 0.4.1. It looks like a object type error, have you ever met the bug? Thank you!