PaddlePaddle / PaddleVideo

Awesome video understanding toolkits based on PaddlePaddle. It supports video data annotation tools, lightweight RGB and skeleton based action recognition model, practical applications for video tagging and sport action detection.
Apache License 2.0
1.53k stars 380 forks source link

slowfast:IndexError: Out of bound indices #651

Open Bradly-s opened 1 year ago

Bradly-s commented 1 year ago

训练过程中出现这种问题,请问如何解决? Traceback (most recent call last): File "/media/dp504/36675aac-be99-45b0-abf0-9c74c037c1b7/PycharmProjects/swf/PaddleVideo/paddlevideo/loader/pipelines/compose.py", line 69, in call data = p(data) File "/media/dp504/36675aac-be99-45b0-abf0-9c74c037c1b7/PycharmProjects/swf/PaddleVideo/paddlevideo/loader/pipelines/decode_sampler.py", line 84, in call frames_select = vr.get_batch(index) #1 for buffer File "/home/dp504/miniconda3/envs/paddle/lib/python3.7/site-packages/decord/video_reader.py", line 174, in get_batch indices = _nd.array(self._validate_indices(indices)) File "/home/dp504/miniconda3/envs/paddle/lib/python3.7/site-packages/decord/video_reader.py", line 132, in _validate_indices raise IndexError('Out of bound indices: {}'.format(indices[indices >= self._num_frame])) IndexError: Out of bound indices: [28 28 28]

westfish commented 9 months ago

根据你提供的错误信息,问题出在尝试访问超出范围的索引。这可能是由于你的数据集中的某些视频的帧数少于你想要获取的帧数。

在你的代码中,vr.get_batch(index)试图获取索引为[28 28 28]的帧,但这些索引超出了视频的帧数范围。这可能是因为你的数据集中的某些视频的帧数少于28。

你需要确保你的数据集中的所有视频的帧数都大于或等于你想要获取的帧数。你可以通过计算每个视频的帧数并与你的索引进行比较来进行这个检查。

另外,如果有图像、视频理解和生成的需求,可以使用我们新的跨模态工具: https://github.com/PaddlePaddle/PaddleMIX/tree/develop