lucidrains / imagen-pytorch

Implementation of Imagen, Google's Text-to-Image Neural Network, in Pytorch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Assert prevents mixed_precision?

mattmisk opened this issue · comments

Line 2661 of imagen_pytorch:

assert images.dtype == torch.float, f'images tensor needs to be floats but {images.dtype} dtype found instead'

This assert triggers when using mixed_precision = True. Am I doing something wrong, or is this a bug? Everything works fine if I comment the line out.

@mattmisk oh nice catch! put in a quick fix

@mattmisk generated images look ok?

@mattmisk generated images look ok?

Yes, but my application is unique and still in development (dataset acquisition, processing, etc.). It's on my list to do a head-to-head comparison with and without mixed precision.