This commit is contained in:
parent
c56e2c9fd1
commit
c104f30137
2
entry.py
2
entry.py
|
|
@ -151,6 +151,6 @@ with torch.no_grad():
|
|||
model.first_stage_model.cpu()
|
||||
|
||||
import cv2
|
||||
samples = einops.rearrange(samples, 'b c h w -> b h w c')[0] * 255.0
|
||||
samples = einops.rearrange(samples, 'b c h w -> b h w c')[0, :, :, ::-1] * 255.0
|
||||
samples = samples.cpu().numpy().clip(0, 255).astype(np.uint8)
|
||||
cv2.imwrite('img.png', samples)
|
||||
|
|
|
|||
BIN
img.png
BIN
img.png
Binary file not shown.
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 1.5 MiB |
|
|
@ -272,7 +272,9 @@ class SiLU(nn.Module):
|
|||
|
||||
class GroupNorm32(nn.GroupNorm):
|
||||
def forward(self, x):
|
||||
return super().forward(x)
|
||||
self.weight.to(torch.float32)
|
||||
self.bias.to(torch.float32)
|
||||
return super().forward(x.float()).type(x.dtype)
|
||||
|
||||
|
||||
def conv_nd(dims, *args, **kwargs):
|
||||
|
|
|
|||
Loading…
Reference in New Issue