GFPGANv1.3-to-ncnn icon indicating copy to clipboard operation
GFPGANv1.3-to-ncnn copied to clipboard

export style model error

Open XdpAreKid opened this issue 2 years ago • 4 comments

hi, i use your project to export style model and face this error.

/media/disk_docker/miniconda3/envs/YOLOX/bin/python /media/disk_docker/XdpWork/vkProcess/GFPGANv1.3-to-ncnn/GFPGANv1.3-to-ncnn/Export_StyleGAN2GeneratorClean_to_ONNX.py /media/disk_docker/XdpWork/vkProcess/GFPGANv1.3-to-ncnn/GFPGANv1.3-to-ncnn/gfpgan/archs/stylegan2_clean_arch.py:321: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! if not input_is_latent: /media/disk_docker/XdpWork/vkProcess/GFPGANv1.3-to-ncnn/GFPGANv1.3-to-ncnn/gfpgan/archs/stylegan2_clean_arch.py:325: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! if randomize_noise: /media/disk_docker/XdpWork/vkProcess/GFPGANv1.3-to-ncnn/GFPGANv1.3-to-ncnn/gfpgan/archs/stylegan2_clean_arch.py:330: TracerWarning: Converting a tensor to a Python boolean might cause the trace to be incorrect. We can't record the data flow of Python values, so this value will be treated as a constant in the future. This means that the trace might not generalize to other inputs! if truncation < 1: Traceback (most recent call last): File "/media/disk_docker/XdpWork/vkProcess/GFPGANv1.3-to-ncnn/GFPGANv1.3-to-ncnn/Export_StyleGAN2GeneratorClean_to_ONNX.py", line 66, in convert_static_GFPGANv1Clean_1_3_onnx() File "/media/disk_docker/XdpWork/vkProcess/GFPGANv1.3-to-ncnn/GFPGANv1.3-to-ncnn/Export_StyleGAN2GeneratorClean_to_ONNX.py", line 43, in convert_static_GFPGANv1Clean_1_3_onnx torch.onnx.export(inference_model, # model being run File "/media/disk_docker/miniconda3/envs/YOLOX/lib/python3.8/site-packages/torch/onnx/init.py", line 350, in export return utils.export( File "/media/disk_docker/miniconda3/envs/YOLOX/lib/python3.8/site-packages/torch/onnx/utils.py", line 163, in export _export( File "/media/disk_docker/miniconda3/envs/YOLOX/lib/python3.8/site-packages/torch/onnx/utils.py", line 1074, in _export graph, params_dict, torch_out = _model_to_graph( File "/media/disk_docker/miniconda3/envs/YOLOX/lib/python3.8/site-packages/torch/onnx/utils.py", line 731, in _model_to_graph graph = _optimize_graph( File "/media/disk_docker/miniconda3/envs/YOLOX/lib/python3.8/site-packages/torch/onnx/utils.py", line 308, in _optimize_graph graph = _C._jit_pass_onnx(graph, operator_export_type) File "/media/disk_docker/miniconda3/envs/YOLOX/lib/python3.8/site-packages/torch/onnx/init.py", line 416, in _run_symbolic_function return utils._run_symbolic_function(*args, **kwargs) File "/media/disk_docker/miniconda3/envs/YOLOX/lib/python3.8/site-packages/torch/onnx/utils.py", line 1406, in _run_symbolic_function return symbolic_fn(g, *inputs, **attrs) File "/media/disk_docker/miniconda3/envs/YOLOX/lib/python3.8/site-packages/torch/onnx/symbolic_helper.py", line 234, in wrapper return fn(g, *args, **kwargs) File "/media/disk_docker/miniconda3/envs/YOLOX/lib/python3.8/site-packages/torch/onnx/symbolic_opset9.py", line 1690, in _convolution raise RuntimeError( RuntimeError: Unsupported: ONNX export of convolution for kernel of unknown shape.

Process finished with exit code 1

can you help me to solve this error?

XdpAreKid avatar Jan 31 '23 17:01 XdpAreKid

+1. @XdpAreKid did u solve it?

zimenglan-sysu-512 avatar Jul 26 '23 06:07 zimenglan-sysu-512

I'm sorry, but I don't have time right now as I'm busy with another project.

magicse avatar Jul 30 '23 14:07 magicse

+1 How to solve it?

kaikaizhu avatar Nov 30 '23 02:11 kaikaizhu

May be problem with versions of packages It was made with pytorch version lower 2,0

magicse avatar Nov 30 '23 04:11 magicse

Hi, @XdpAreKid @kaikaizhu @zimenglan-sysu-512 have any of you solved this issue?

alasokolova avatar May 23 '24 08:05 alasokolova

Hi, @XdpAreKid @kaikaizhu @zimenglan-sysu-512 have any of you solved this issue?

https://github.com/XdpAreKid/GFPGAN-ncnn

XdpAreKid avatar May 24 '24 01:05 XdpAreKid