SRFBN_CVPR19 icon indicating copy to clipboard operation
SRFBN_CVPR19 copied to clipboard

How to use single GPU to train SRFBN?

Open shiqi1994 opened this issue 6 years ago • 5 comments

I modify the parameter in the file named 'train_SRFBN_example.json': "gpu_ids": [0], but when I start training process, it use my all GPUs. How can I deal with this? Your early reply will be appreciated. :)

shiqi1994 avatar Jun 24 '19 12:06 shiqi1994

You can change the value of split_batch in json file for training on one GPU.

Paper99 avatar Jun 25 '19 05:06 Paper99

Could you please give me more details about how to train on a single GPU? I have already tried to change split_batch to 2,3... , but it still takes up all of my GPUs while training....

ShunLiu1992 avatar Oct 17 '19 12:10 ShunLiu1992

Could you please give me more details about how to train on a single GPU? I have already tried to change split_batch to 2,3... , but it still takes up all of my GPUs while training....

Did you try do set gpu_ids:[0] and set split_batch to 1?

shiqi1994 avatar Oct 19 '19 13:10 shiqi1994

Could you please give me more details about how to train on a single GPU? I have already tried to change split_batch to 2,3... , but it still takes up all of my GPUs while training....

Did you try do set gpu_ids:[0] and set split_batch to 1?

Yes, I did try this configuration... I also set gpu_ids:[0,1] and split_batch to be 1, but it still uses my all three GPUs...

ShunLiu1992 avatar Oct 20 '19 05:10 ShunLiu1992

@ShunLiu1992 在networks / init.py @里第134行修改为:

 if torch.cuda.is_available():
        #net = nn.DataParallel(net).cuda()
        net = net.cuda()

  return net

yichuan123 avatar Apr 24 '20 08:04 yichuan123