Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] Fixed typo in loop condition for testing model. #495

Open
wants to merge 1 commit into
base: 0.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions mmselfsup/utils/collect.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ def nondist_forward_collect(func, data_loader, length):
results_all (dict(np.ndarray)): The concatenated outputs.
"""
results = []
prog_bar = mmcv.ProgressBar(len(data_loader))
for i, data in enumerate(data_loader):
prog_bar = mmcv.ProgressBar(len(data_loader.dataset))
for i, data in enumerate(data_loader.dataset):
input_data = dict(img=data['img'])
with torch.no_grad():
result = func(**input_data) # feat_dict
Expand Down Expand Up @@ -58,8 +58,8 @@ def dist_forward_collect(func, data_loader, rank, length, ret_rank=-1):
"""
results = []
if rank == 0:
prog_bar = mmcv.ProgressBar(len(data_loader))
for idx, data in enumerate(data_loader):
prog_bar = mmcv.ProgressBar(len(data_loader.dataset))
for idx, data in enumerate(data_loader.dataset):
with torch.no_grad():
result = func(**data) # dict{key: tensor}
results.append(result)
Expand Down