OpenGVLab / UniFormerV2

[ICCV2023] UniFormerV2: Spatiotemporal Learning by Arming Image ViTs with Video UniFormer
https://arxiv.org/abs/2211.09552
Apache License 2.0
291 stars 18 forks source link

Program can not load frames of videos in sth-sth v2 dataset #14

Closed HaihangWu closed 1 year ago

HaihangWu commented 1 year ago

When I run train the model on sth-sth v2 dataset, it shows "Not a directory: '/data/gpfs/projects/punim0512/data/sth-sthv2/20bn-something-something-v2/22139/img_00001.jpg'". I think the program tries to load the first frames of video 22139.webm in sth-sth v2 dataset, but it takes the frame as a image in a directory, but in my sth-sth v2 directory, all files are ".webm" files and there is no subdirectory . Any idea about this? Thanks

NotADirectoryError: Caught NotADirectoryError in DataLoader worker process 0. Original Traceback (most recent call last): File "/data/gpfs/projects/punim0512/haihang_envs/Uniformerv2/lib/python3.9/site-packages/torch/utils/data/_utils/worker.py", line 302, in _worker_loop data = fetcher.fetch(index) File "/data/gpfs/projects/punim0512/haihang_envs/Uniformerv2/lib/python3.9/site-packages/torch/utils/data/_utils/fetch.py", line 58, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/data/gpfs/projects/punim0512/haihang_envs/Uniformerv2/lib/python3.9/site-packages/torch/utils/data/_utils/fetch.py", line 58, in data = [self.dataset[idx] for idx in possibly_batched_index] File "/data/gpfs/projects/punim0512/Haihangw-Projects/video_train/Uniformer/slowfast/datasets/sth.py", line 234, in getitem utils.retry_load_images( File "/data/gpfs/projects/punim0512/Haihangw-Projects/video_train/Uniformer/slowfast/datasets/utils.py", line 35, in retry_load_images with g_pathmgr.open(image_path, "rb") as f: File "/home/haihangw/.local/lib/python3.9/site-packages/iopath/common/file_io.py", line 1062, in open bret = handler._open(path, mode, buffering=buffering, **kwargs) # type: ignore File "/home/haihangw/.local/lib/python3.9/site-packages/iopath/common/file_io.py", line 645, in _open return open( # type: ignore NotADirectoryError: [Errno 20] Not a directory: '/data/gpfs/projects/punim0512/data/sth-sthv2/20bn-something-something-v2/22139/img_00001.jpg'

Andy1621 commented 1 year ago

If you use videos to train sthsthv2, you can simply reuse kinetics_sparse.py.

HaihangWu commented 1 year ago

Thanks. In the label file "somesomev2_rgb_test_split", there are 2 columns. The first column is video ID. Is the second column the label for the videos?

Andy1621 commented 1 year ago

Yes. Since there is no available testing split, researchers copy the validation split.