Skip to content

Commit

Permalink
fix #124
Browse files Browse the repository at this point in the history
  • Loading branch information
xumingw committed Jul 3, 2024
1 parent c1ce01f commit 9fc2817
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scripts/train_stage1.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"""

import argparse
import copy
import logging
import math
import os
Expand Down Expand Up @@ -211,6 +212,7 @@ def log_validation(
logger.info("Running validation... ")

ori_net = accelerator.unwrap_model(net)
ori_net = copy.deepcopy(ori_net)
reference_unet = ori_net.reference_unet
denoising_unet = ori_net.denoising_unet
face_locator = ori_net.face_locator
Expand Down Expand Up @@ -278,6 +280,7 @@ def log_validation(
canvas.save(out_file)

del pipe
del ori_net
torch.cuda.empty_cache()

return pil_images
Expand Down

0 comments on commit 9fc2817

Please sign in to comment.