From 099957c907609167f68e4642b69fd5410d2da282 Mon Sep 17 00:00:00 2001 From: littletomatodonkey <2120160898@bit.edu.cn> Date: Tue, 27 Apr 2021 10:32:17 +0800 Subject: [PATCH] fix eval laoder on win (#2654) --- tools/program.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/program.py b/tools/program.py index 0aa3307e..db8e44df 100755 --- a/tools/program.py +++ b/tools/program.py @@ -18,6 +18,7 @@ from __future__ import print_function import os import sys +import platform import yaml import time import shutil @@ -338,8 +339,10 @@ def eval(model, valid_dataloader, post_process_class, eval_class, total_frame = 0.0 total_time = 0.0 pbar = tqdm(total=len(valid_dataloader), desc='eval model:') + max_iter = len(valid_dataloader) - 1 if platform.system( + ) == "Windows" else len(valid_dataloader) for idx, batch in enumerate(valid_dataloader): - if idx >= len(valid_dataloader): + if idx >= max_iter: break images = batch[0] start = time.time() -- GitLab