Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

多卡训练的问题 #4

Closed
ymj98 opened this issue Nov 2, 2021 · 1 comment
Closed

多卡训练的问题 #4

ymj98 opened this issue Nov 2, 2021 · 1 comment

Comments

@ymj98
Copy link

ymj98 commented Nov 2, 2021

您好,请问一下代码是只支持单卡训练么?可以进行多卡训练么

@cjy-4
Copy link
Collaborator

cjy-4 commented Jan 2, 2023

We set the batch size to 1 in our experiments and training on single GPU.
Basically, we have implemented some code here to support multiple GPUs:

if len(gpu_ids) > 0:
assert(torch.cuda.is_available())
net.to(gpu_ids[0])
net = torch.nn.DataParallel(net, gpu_ids) # multi-GPUs
init_weights(net, init_type, init_gain=init_gain)

You can set --gpu_ids 0,1,... to work on multiple GPUs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants