RuntimeError: "reflection_pad2d" not implemented for 'Half' #74

Open
opened 2026-01-29 21:40:57 +00:00 by claunia · 0 comments
Owner

Originally created by @abdirk01 on GitHub (Sep 20, 2021).

Hi, I just want to try this out. Without CODA it is running fine, but as soon as I use it with CODA I get the following error:

Traceback (most recent call last):
File "\GFPGAN\inference_gfpgan.py", line 98, in
main()
File "\GFPGAN\inference_gfpgan.py", line 67, in main
cropped_faces, restored_faces, restored_img = restorer.enhance(
File "\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\autograd\grad_mode.py", line 28, in decorate_context
return func(*args, **kwargs)
File "\GFPGAN\gfpgan\utils.py", line 105, in enhance
bg_img = self.bg_upsampler.enhance(img, outscale=self.upscale)[0]
File "\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\autograd\grad_mode.py", line 28, in decorate_context
return func(*args, **kwargs)
File "\AppData\Local\Programs\Python\Python39\lib\site-packages\realesrgan\utils.py", line 168, in enhance
self.pre_process(img)
File "\AppData\Local\Programs\Python\Python39\lib\site-packages\realesrgan\utils.py", line 64, in pre_process
self.img = F.pad(self.img, (0, self.mod_pad_w, 0, self.mod_pad_h), 'reflect')
File "\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\nn\functional.py", line 4170, in _pad
return torch._C._nn.reflection_pad2d(input, pad)
RuntimeError: "reflection_pad2d" not implemented for 'Half'

It's on a Windows 10 Laptop.

Thanks for your help!
Dirk

Originally created by @abdirk01 on GitHub (Sep 20, 2021). Hi, I just want to try this out. Without CODA it is running fine, but as soon as I use it with CODA I get the following error: > Traceback (most recent call last): > File "\GFPGAN\inference_gfpgan.py", line 98, in <module> > main() > File "\GFPGAN\inference_gfpgan.py", line 67, in main > cropped_faces, restored_faces, restored_img = restorer.enhance( > File "\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\autograd\grad_mode.py", line 28, in decorate_context > return func(*args, **kwargs) > File "\GFPGAN\gfpgan\utils.py", line 105, in enhance > bg_img = self.bg_upsampler.enhance(img, outscale=self.upscale)[0] > File "\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\autograd\grad_mode.py", line 28, in decorate_context > return func(*args, **kwargs) > File "\AppData\Local\Programs\Python\Python39\lib\site-packages\realesrgan\utils.py", line 168, in enhance > self.pre_process(img) > File "\AppData\Local\Programs\Python\Python39\lib\site-packages\realesrgan\utils.py", line 64, in pre_process > self.img = F.pad(self.img, (0, self.mod_pad_w, 0, self.mod_pad_h), 'reflect') > File "\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\nn\functional.py", line 4170, in _pad > return torch._C._nn.reflection_pad2d(input, pad) > RuntimeError: "reflection_pad2d" not implemented for 'Half' It's on a Windows 10 Laptop. Thanks for your help! Dirk
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: TencentARC/GFPGAN#74