diff --git a/torchvision/datasets/ucf101.py b/torchvision/datasets/ucf101.py index 43d8124bd4b..464eb0018f2 100644 --- a/torchvision/datasets/ucf101.py +++ b/torchvision/datasets/ucf101.py @@ -88,10 +88,10 @@ def _select_fold(self, video_list, annotation_path, fold, train): with open(f, "r") as fid: data = fid.readlines() data = [x.strip().split(" ") for x in data] - data = [x[0] for x in data] + data = [os.path.join(self.root, x[0]) for x in data] selected_files.extend(data) selected_files = set(selected_files) - indices = [i for i in range(len(video_list)) if video_list[i][len(self.root) + 1:] in selected_files] + indices = [i for i in range(len(video_list)) if video_list[i] in selected_files] return indices def __len__(self):