mirror of
https://github.com/TencentARC/GFPGAN.git
synced 2026-04-24 06:41:32 +00:00
How to specify the device #423
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Crestina2001 on GitHub (Dec 25, 2023).
Hi, I am using the model for inference. I have several GPUs, and I would like to split the images for different GPUs to infer. How to move the restorer to different GPUs? restorer.to(device) does not work.
@Silas1704 commented on GitHub (Jan 23, 2024):
@Crestina2001 In PyTorch try using torch.nn.DataParallel or torch.nn.parallel.DistributedDataParallel .when using DataParallel, the model will be replicated across all available GPUs, and each GPU will process a portion of the input data Wrap the model with DataParallel:
restorer = nn.DataParallel(restorer).
Then concatenate the results
@jdc4429 commented on GitHub (Jul 20, 2024):
what about specifing a GPU other then 0? I am trying to get it to use gpu1 but my attempts have failed.