Skip to content

Commit

Permalink
Fix: Fix no folder error after generate.
Browse files Browse the repository at this point in the history
  • Loading branch information
chairc committed Sep 26, 2023
1 parent 6529f80 commit 5b15de6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tools/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from model.ddim import Diffusion as DDIMDiffusion
from model.network import UNet
from utils.initializer import device_initializer, load_model_weight_initializer
from utils.utils import plot_images, save_images
from utils.utils import plot_images, save_images, check_and_create_dir

logger = logging.getLogger(__name__)
coloredlogs.install(level="INFO")
Expand Down Expand Up @@ -50,6 +50,8 @@ def generate(args):
result_path = args.result_path
# Run device initializer
device = device_initializer()
# Check and create result path
check_and_create_dir(result_path)
# Initialize the diffusion model
if sample == "ddpm":
diffusion = DDPMDiffusion(img_size=image_size, device=device)
Expand Down

0 comments on commit 5b15de6

Please sign in to comment.