Unverified Commit 5d75c7a8 authored by WRH's avatar WRH Committed by GitHub
Browse files

[Enhancement]: use len(result) as batch size (#987)

* use len(result) as batch size

* remove old comments

* Add comments to this modification

* Update test.py
parent fffc8757
......@@ -32,8 +32,8 @@ def single_gpu_test(model, data_loader):
result = model(return_loss=False, **data)
results.extend(result)
# use the first key as main key to calculate the batch size
batch_size = len(next(iter(data.values())))
# Assume result has the same length of batch_size, refer to https://github.com/open-mmlab/mmcv/issues/985
batch_size = len(result)
for _ in range(batch_size):
prog_bar.update()
return results
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment