Don't log if you aren't 0 rank

This commit is contained in:
James Betker 2020-10-03 11:14:13 -06:00
parent 922b1d76df
commit 6c9718ad64
2 changed files with 3 additions and 2 deletions

View File

@ -300,7 +300,8 @@ class ExtensibleTrainer(BaseModel):
for name, net in netdict.items():
load_path = self.opt['path']['pretrain_model_%s' % (name,)]
if load_path is not None:
logger.info('Loading model for [%s]' % (load_path))
if self.rank <= 0:
logger.info('Loading model for [%s]' % (load_path,))
self.load_network(load_path, net, self.opt['path']['strict_load'])
def save(self, iter_step):

View File

@ -294,7 +294,7 @@ def main():
# log
logger.info('# Validation # PSNR: {:.4e} Fea: {:.4e}'.format(avg_psnr, avg_fea_loss))
# tensorboard logger
if opt['use_tb_logger'] and 'debug' not in opt['name']:
if opt['use_tb_logger'] and 'debug' not in opt['name'] and rank <= 0:
#tb_logger.add_scalar('val_psnr', avg_psnr, current_step)
tb_logger.add_scalar('val_fea', avg_fea_loss, current_step)