mirror of
https://github.com/TencentARC/GFPGAN.git
synced 2026-02-16 06:14:33 +00:00
Can't use .half() with new GFPGAN clean #57
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 @marcelodiaz558 on GitHub (Aug 24, 2021).
Hi! For the previous paper version, I was used to using FP16 weights with the model, which helped to have faster processing, now very weird results are generated if I apply model.half() and I use HalfTensors as the model input.
This is what I am doing:
For loading the model:
For the model inputs:
When I remove the above lines of codes everything works fine, but inference time is 44% bigger compared to the paper's version with half weights (looks like that quality isn't that good either, but that's another story). With .half() inference time is 20% bigger, but no result is generated.
These are the results I get:

@xinntao commented on GitHub (Aug 29, 2021):
We have also noticed this problem.
It is because this line:
d7cb9f77f1/gfpgan/archs/stylegan2_clean_arch.py (L21)this operation will have a numerical error when using half.
We may remove this line and fine-tune the model, so that the new model can also use the half inference.
@zhoumenghan commented on GitHub (Feb 20, 2023):
any update about the half inference?