Skip to content

Commit

Permalink
Merge pull request #82 from chairc/dev
Browse files Browse the repository at this point in the history
Modify check_and_create_dir function; Modify comment.
  • Loading branch information
chairc authored Aug 2, 2024
2 parents e1ca138 + 2d9c6a4 commit c191dee
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tools/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def train(rank=None, args=None):
for i, (images, labels) in enumerate(pbar):
# The images are all resized in dataloader
images = images.to(device)
# Generates a tensor of size images.shape[0] * images.shape[0] randomly sampled time steps
# Generates a tensor of size images.shape[0] randomly sampled time steps
time = diffusion.sample_time_steps(images.shape[0]).to(device)
# Add noise, return as x value at time t and standard normal distribution
x_time, noise = diffusion.noise_images(x=images, time=time)
Expand Down
3 changes: 1 addition & 2 deletions utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,5 @@ def check_and_create_dir(path):
:param path: Create path
:return: None
"""
logger.warning(msg=f"Folder '{path}' is not exist.")
logger.info(msg=f"Check and create folder '{path}'.")
os.makedirs(name=path, exist_ok=True)
logger.info(msg=f"Successfully create folder '{path}'.")
2 changes: 1 addition & 1 deletion webui/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def train(self, seed, conditional, sample, network, run_name, epochs, batch_size
return
# The images are all resized in dataloader
images = images.to(device)
# Generates a tensor of size images.shape[0] * images.shape[0] randomly sampled time steps
# Generates a tensor of size images.shape[0] randomly sampled time steps
time = diffusion.sample_time_steps(images.shape[0]).to(device)
# Add noise, return as x value at time t and standard normal distribution
x_time, noise = diffusion.noise_images(x=images, time=time)
Expand Down

0 comments on commit c191dee

Please sign in to comment.