zhangzjn/ADer

导出模型为onnx,vitAD成功,invAD及InvAD-lite均报错?

Closed this issue · 2 comments

首先非常惊赞叹作者们的杰出创作!感谢无私开源!

在拜读论文及源码之后,我尝试将模型导出为onnx,但是发现只有vitAD成功,invAD及InvAD-lite均报错,其它还没来得及测试。
torch版本 2.3.0 和 1.13.1 都测试了,报错相同,大致如下:

torch.onnx.export(self.net, x, "inv.onnx")
Traceback (most recent call last):
File "", line 1, in
File "f:\pyenv\Torchgpu\lib\site-packages\torch\onnx\utils.py", line 516, in export
_export(
File "f:\pyenv\Torchgpu\lib\site-packages\torch\onnx\utils.py", line 1612, in _export
graph, params_dict, torch_out = _model_to_graph(
File "f:\pyenv\Torchgpu\lib\site-packages\torch\onnx\utils.py", line 1138, in _model_to_graph
graph = _optimize_graph(
File "f:\pyenv\Torchgpu\lib\site-packages\torch\onnx\utils.py", line 619, in _optimize_graph
_C._jit_pass_peephole(graph, True)
IndexError: Argument passed to at() was not in the map.

百度谷歌了一圈也没甚收效,麻烦你们给看看,有没有什么发现或线索,谢谢!

I hypothesize that InvAD likely relies on operators in model/stylegan2_op, and these operators are non-native implementations by PyTorch. You can search to see if anyone has successfully exported StyleGANv2 to ONNX and refer to their solutions.

I hypothesize that InvAD likely relies on operators in model/stylegan2_op, and these operators are non-native implementations by PyTorch. You can search to see if anyone has successfully exported StyleGANv2 to ONNX and refer to their solutions.

好的,感谢回复,我再试试。