GFPGAN
GFPGAN copied to clipboard
have trouble export "GFPGANCleanv1-NoCE-C2.pth" to ONNX
Dear Wang,
Great work! I am having trouble export GFPGANCleanv1-NoCE-C2.pth to onnx.
Could you please share GFPGANCleanv1-NoCE-C2.onnx for us?
Many thanks!
@Nise-2-meet-U the same issue with you. Have you sloved this issue? 0.0
I have sloved it. Some issues are : 1、noise = out.new_empty(b, 1, h, w).normal_() in stylegan2_clean_arch.py can‘t be supported in ONNX. I move it out the Model class, like noise = Noise[i], the Noise is a list or others which prestores generated random noise. 2、the forward function of Model is very bad, especially stylegan, so many " if else " and class be reused. Like the StyleConv " in "useself.style_convs.append StyleConv ...". So I rewrite and make it in single forward, load the ,GFPGANCleanv1-NoCE-C2.pth, it works. This step is time-consuming. 3、I also find the F.conv2d op not be supported for tensorrt, but it's not easy.
I have sloved it. Some issues are : 1、noise = out.new_empty(b, 1, h, w).normal_() in stylegan2_clean_arch.py can‘t be supported in ONNX. I move it out the Model class, like noise = Noise[i], the Noise is a list or others which prestores generated random noise. 2、the forward function of Model is very bad, especially stylegan, so many " if else " and class be reused. Like the StyleConv " in "useself.style_convs.append StyleConv ...". So I rewrite and make it in single forward, load the ,GFPGANCleanv1-NoCE-C2.pth, it works. This step is time-consuming. 3、I also find the F.conv2d op not be supported for tensorrt, but it's not easy.
Thanks a lot. @lyx326 I will try the issues above . Also I am trying torch.jit.track to employ on X64 cpu., it's ok. But if using torch.jit.script , it still has issues. I am confused . ^~^
I have sloved it. Some issues are : 1、noise = out.new_empty(b, 1, h, w).normal_() in stylegan2_clean_arch.py can‘t be supported in ONNX. I move it out the Model class, like noise = Noise[i], the Noise is a list or others which prestores generated random noise. 2、the forward function of Model is very bad, especially stylegan, so many " if else " and class be reused. Like the StyleConv " in "useself.style_convs.append StyleConv ...". So I rewrite and make it in single forward, load the ,GFPGANCleanv1-NoCE-C2.pth, it works. This step is time-consuming. 3、I also find the F.conv2d op not be supported for tensorrt, but it's not easy.
Hi,I am a freshman.I tried to modefy the stylegan2_clean_arch.py ,After two days, I still can't success.I am confused. Could you send me ac copy the stylegan2_clean_arch.py? My Email: [email protected] . Thanks a lot. 0.0
I have sloved it. Some issues are : 1、noise = out.new_empty(b, 1, h, w).normal_() in stylegan2_clean_arch.py can‘t be supported in ONNX. I move it out the Model class, like noise = Noise[i], the Noise is a list or others which prestores generated random noise. 2、the forward function of Model is very bad, especially stylegan, so many " if else " and class be reused. Like the StyleConv " in "useself.style_convs.append StyleConv ...". So I rewrite and make it in single forward, load the ,GFPGANCleanv1-NoCE-C2.pth, it works. This step is time-consuming. 3、I also find the F.conv2d op not be supported for tensorrt, but it's not easy.
Hello,I'm a fresh hand,pth2onnx really confused me,I tried , import Net-load_state_dict-Random Input-export,Could you give me a hand,My Email: [email protected]. Chress。
can you please share the steps or does anyone have converted onnx model?? @Alexander-code-365 , @lyx326
Well Done @lyx326 ! Could you share the ONNX model with me, my email is [email protected] Thank you very much!
@lyx326 Can you share your ONNX model or steps you used for converting it to ONNX?
@lyx326 Can you share steps you used for converting it to ONNX?
I have sloved it. Some issues are : 1、noise = out.new_empty(b, 1, h, w).normal_() in stylegan2_clean_arch.py can‘t be supported in ONNX. I move it out the Model class, like noise = Noise[i], the Noise is a list or others which prestores generated random noise. 2、the forward function of Model is very bad, especially stylegan, so many " if else " and class be reused. Like the StyleConv " in "useself.style_convs.append StyleConv ...". So I rewrite and make it in single forward, load the ,GFPGANCleanv1-NoCE-C2.pth, it works. This step is time-consuming. 3、I also find the F.conv2d op not be supported for tensorrt, but it's not easy.
Hi,I am a freshman.I tried to modefy the stylegan2_clean_arch.py ,After two days, I still can't success.I am confused. Could you send me ac copy the stylegan2_clean_arch.py? My Email: [email protected] . Thanks a lot. 0.0
can you solved this problem ? Can you share your ONNX model or steps you used for converting it to ONNX , my email is [email protected]
did anyone suceed ? @lyx326 @kelisiya @farazBhatti @rizwanishaq . Please share steps or onnx model.
@kelisiya @farazBhatti @rizwanishaq @sharozekkel Can you share your ONNX model or steps you used for converting it to ONNX ,my email is [email protected]
@kelisiya @farazBhatti @rizwanishaq @sharozekkel @peanut1101
Please help share onnx model file or script to convert .pth pre-trained models to onnx. Tried multiple options...But, not able to ....email: [email protected]
Thank you
@kelisiya @farazBhatti @rizwanishaq @sharozekkel @peanut1101 @spradeep28 Can anyone, please share the onnx model if they were successful in exporting it? ... email: [email protected]
F.conv2d
Should be supported with the latest updates from RT
A demo for onnxruntime, https://github.com/xuanandsix/GFPGAN-onnxruntime-demo
A simple face restoration TensorRT deployment solution https://github.com/bychen7/Face-Restoration-TensorRT.
A demo for onnxruntime, https://github.com/xuanandsix/GFPGAN-onnxruntime-demo
too late,2021.01. but,thanks.