Skip to content

Commit

Permalink
fixbug: metric_data always initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
xinntao committed Oct 3, 2021
1 parent 4f2e81d commit 2a590e9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion basicsr/models/sr_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def nondist_validation(self, dataloader, current_iter, tb_logger, save_img):
with_metrics = self.opt['val'].get('metrics') is not None
if with_metrics:
self.metric_results = {metric: 0 for metric in self.opt['val']['metrics'].keys()}
metric_data = dict()
metric_data = dict()
pbar = tqdm(total=len(dataloader), unit='image')

for idx, val_data in enumerate(dataloader):
Expand Down
2 changes: 1 addition & 1 deletion basicsr/models/video_base_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def dist_validation(self, dataloader, current_iter, tb_logger, save_img):
if with_metrics:
for _, tensor in self.metric_results.items():
tensor.zero_()
metric_data = dict()
metric_data = dict()
# record all frames (border and center frames)
if rank == 0:
pbar = tqdm(total=len(dataset), unit='frame')
Expand Down
2 changes: 1 addition & 1 deletion basicsr/models/video_recurrent_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def dist_validation(self, dataloader, current_iter, tb_logger, save_img):
if with_metrics:
for _, tensor in self.metric_results.items():
tensor.zero_()
metric_data = dict()
metric_data = dict()
num_folders = len(dataset)
num_pad = (world_size - (num_folders % world_size)) % world_size
if rank == 0:
Expand Down

0 comments on commit 2a590e9

Please sign in to comment.