jiangyzy / GOAE

[ICCV 2023] Official implementation of "Make Encoder Great Again in 3D GAN Inversion through Geometry and Occlusion-Aware Encoding" in International Conference on Computer Vision (ICCV) 2023.
85 stars 8 forks source link

Variable not on cuda #1

Closed yummyJade closed 9 months ago

yummyJade commented 1 year ago

Thank you for your great job! I notice there may be a mistake in inference code

image

logit_scale = torch.clamp(self.logit_scale, max=torch.log(torch.tensor(1. / 0.01))).exp()

it can fixed by

logit_scale = torch.clamp(self.logit_scale, max=torch.log(torch.tensor(1. / 0.01)).to('cuda')).exp()
jiangyzy commented 1 year ago

Thank you for your great job! I notice there may be a mistake in inference code

image

logit_scale = torch.clamp(self.logit_scale, max=torch.log(torch.tensor(1. / 0.01))).exp()

it can fixed by

logit_scale = torch.clamp(self.logit_scale, max=torch.log(torch.tensor(1. / 0.01)).to('cuda')).exp()

Thanks for your criticism, original code works well on torch==1.11.0, the fixed one is more flexible.