From 457c312fe35daa56aea44d29fd57acdaf659bbf9 Mon Sep 17 00:00:00 2001 From: JuarezCulau <88636064+JuarezCulau@users.noreply.github.com> Date: Wed, 23 Aug 2023 12:42:02 -0300 Subject: [PATCH 1/2] Single GPU Fix --- realesrgan/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/realesrgan/utils.py b/realesrgan/utils.py index 67e5232d6..1570b320f 100644 --- a/realesrgan/utils.py +++ b/realesrgan/utils.py @@ -45,7 +45,7 @@ def __init__(self, self.half = half # initialize model - if gpu_id: + if gpu_id and gpu_id != 0: self.device = torch.device( f'cuda:{gpu_id}' if torch.cuda.is_available() else 'cpu') if device is None else device else: From b27d8525d54c6fdd2862d5202d45049abdccdc3f Mon Sep 17 00:00:00 2001 From: Juarez Culau <88636064+JuarezCulau@users.noreply.github.com> Date: Wed, 10 Jan 2024 12:27:37 -0400 Subject: [PATCH 2/2] Update utils.py --- realesrgan/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/realesrgan/utils.py b/realesrgan/utils.py index 1570b320f..ce91c9f30 100644 --- a/realesrgan/utils.py +++ b/realesrgan/utils.py @@ -45,7 +45,7 @@ def __init__(self, self.half = half # initialize model - if gpu_id and gpu_id != 0: + if gpu_id == 0 or gpu_id: self.device = torch.device( f'cuda:{gpu_id}' if torch.cuda.is_available() else 'cpu') if device is None else device else: