chaofengc / PSFRGAN

PyTorch codes for "Progressive Semantic-Aware Style Transformation for Blind Face Restoration", CVPR2021
Other
370 stars 68 forks source link

there is a error when translate the psfrgan_latest_net_G.pth to onnx. #17

Closed zhangyunming closed 3 years ago

zhangyunming commented 3 years ago

hi, thanks for the great work.

when i translate the psfrgan_latest_net_G.pth to onnx, there is a error ocuured, the parsing is ok. 捕获

can you give some advices. thanks

chaofengc commented 3 years ago

The restore model needs pair inputs: (LR_image, parsing_map). You may try to combine them to one input and split them inside the forward function.

zhangyunming commented 3 years ago

hi, thank you so much . i have change the two input into one, the reslut demo is same as two inputs

when i translate to onnx , it said: 捕获22

the 'mv' is not suport by onnx 9 10 11 12.

chaofengc commented 3 years ago

I am not familiar with ONNX and did not consider the code compatibility with onnx. You may have to debug the error and rewrite some operators by yourself.

zhangyunming commented 3 years ago

thanks , but i can not find the operator "mv", did you use the torch.mv in the code?

chaofengc commented 3 years ago

Most possible reason is that ONNX does not support spectral_norm. You may try to find if there are any solution to that.