From d7975c6a9b3814aa09f8a9ad48647f741d097060 Mon Sep 17 00:00:00 2001 From: Jordan Gong Date: Sat, 19 Dec 2020 21:00:02 +0800 Subject: Fix indexing error when no clip to be discard --- utils/dataset.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/utils/dataset.py b/utils/dataset.py index fad94c0..63cffa5 100644 --- a/utils/dataset.py +++ b/utils/dataset.py @@ -103,8 +103,9 @@ class CASIAB(data.Dataset): if len(os.listdir(clip_path)) < self.discard_threshold: discard_clips_names.append(clip_name) clip_names.remove(clip_name) - print(', '.join(discard_clips_names[:-1]), - 'and', discard_clips_names[-1], 'will be discarded.') + if len(discard_clips_names) != 0: + print(', '.join(discard_clips_names[:-1]), + 'and', discard_clips_names[-1], 'will be discarded.') # clip name constructed by label, condition and view # e.g 002-bg-02-090 means clip from Subject #2 -- cgit v1.2.3