CenterNet icon indicating copy to clipboard operation
CenterNet copied to clipboard

How to train it with multi-GPUS?

Open YJLCV opened this issue 6 years ago • 2 comments

How to Use multi-GPU to Train it? I have four 1080ti, 11G, batch_size=12, chunk_size=[3, 3, 3, 3],but it failed.

YJLCV avatar Sep 27 '19 14:09 YJLCV

How to Use multi-GPU to Train it? I have four 1080ti, 11G, batch_size=12, chunk_size=[3, 3, 3, 3],but it failed.

YJLCV avatar Sep 27 '19 14:09 YJLCV

You can just modify your code in 'centernet_od/nnet/py_factory.py" The class init part:

#train on multi-gpu 
self.network = Network(self.model, self.loss).cuda()
#import 'from torch.nn import DataParallel' instead of  'from models.py_utils.data_parallel import DataParallel' 
#self.devices seems like [0, 1, 2, 3] which is the index id of your available gpu index
self.network = DataParallel(self.network, device_ids=list(range(
            self.devices)))

kehuantiantang avatar Feb 15 '20 03:02 kehuantiantang