yuval-alaluf / stylegan3-editing

Official Implementation of "Third Time's the Charm? Image and Video Editing with StyleGAN3" (AIM ECCVW 2022) https://arxiv.org/abs/2201.13433
https://yuval-alaluf.github.io/stylegan3-editing/
MIT License
654 stars 73 forks source link

Exporting trained StyleGan3_Nada model to torchscript #26

Closed muhammad-ahmed-ghani closed 2 years ago

muhammad-ahmed-ghani commented 2 years ago

RuntimeError: cannot statically infer the expected size of a list in this context: File "/content/stylegan_nada/ZSSGAN/op/fused_act.py", line 110 return ( F.leaky_relu( input + bias.view(1, bias.shape[0], *rest_dim), negative_slope=0.2


                )
                * scale
'fused_leaky_relu' is being compiled since it was called from 'EqualLinear.forward'
  File "/content/stylegan_nada/ZSSGAN/model/sg2_model.py", line 154
        if self.activation:
            out = F.linear(input, self.weight * self.scale)
            out = fused_leaky_relu(out, self.bias * self.lr_mul)
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <--- HERE
yuval-alaluf commented 2 years ago

Not sure I exactly follow what you pasted above. And we're not really familiar with torchscript. You should try asking this question on the NADA repo as this seems to be more relevant to their codebase.