Check rank before doing image logging.

This commit is contained in:
James Betker 2020-08-25 16:00:49 -06:00
parent a1800f45ef
commit 09a9079e17

View File

@ -773,7 +773,7 @@ class SRGANModel(BaseModel):
# Log sample images from first microbatch.
if step % self.img_debug_steps == 0:
if step % self.img_debug_steps == 0 and self.rank <= 0:
sample_save_path = os.path.join(self.opt['path']['models'], "..", "temp")
os.makedirs(os.path.join(sample_save_path, "hr"), exist_ok=True)
os.makedirs(os.path.join(sample_save_path, "lr"), exist_ok=True)