I’m taking in latent vecs and generating images, pretty straight forward, but getting less than half the FPS as my Tensorflow model. Can someone help me speed this up?
def convert(model, inputs):
z = inputs['z']
jzf = [float(i) for i in z]
jzft = torch.FloatTensor(jzf)
jzftr = jzft.reshape([1, 512])
latents = jzftr.cuda()
truncation = inputs['truncation']
img = G(latents, None, truncation)
img = (img.permute(0, 2, 3, 1) * 127.5 + 128).clamp(0, 255).to(torch.uint8)
return {'image': img[0].cpu().numpy()}