From 1cf6426b31fe3b7c8c6938a1efc47007e87424bf Mon Sep 17 00:00:00 2001 From: gggmt <1065504814@qq.com> Date: Thu, 2 Dec 2021 15:54:00 +0800 Subject: [PATCH] Update datasets.py Video errors may occur. --- utils/datasets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/datasets.py b/utils/datasets.py index ac81603c7d34..4430321661a7 100755 --- a/utils/datasets.py +++ b/utils/datasets.py @@ -200,7 +200,7 @@ def __next__(self): # Read video self.mode = 'video' ret_val, img0 = self.cap.read() - if not ret_val: + while not ret_val: self.count += 1 self.cap.release() if self.count == self.nf: # last video