facebookresearch / pytorchvideo

A deep learning library for video understanding research.
https://pytorchvideo.org/
Apache License 2.0
3.28k stars 404 forks source link

Hmdb51 returns action class name not index #156

Open xianyuanliu opened 2 years ago

xianyuanliu commented 2 years ago

🐛 Bugs / Unexpected behaviors

pytorchvideo.data.Hmdb51 returns action class name instead of action class number according to this code. In the train_step, batch["label"] returns action class name, not class index. Therefore, I cannot use them to calculate loss and accuracy. I am not sure if it is designed for some reason. May I know how to fix it, please? Many thanks!

Instructions To Reproduce the Issue:

Follow video_classification_example and change the dataset to HMDB51.

    train_dataset = LimitDataset(
        Hmdb51(
            data_path=Path(root).joinpath("testTrainMulti_7030_splits"),
            clip_sampler=make_clip_sampler("uniform", frame_per_segment),
            decode_audio=False,
            transform=video_transform(mode="train"),
            video_path_prefix=str(Path(root).joinpath("video")),
        )
    )
  1. Any changes you made (git diff) or code you wrote --- Nope
  2. The exact command(s) you ran: --- Nope
  3. What you observed (including the full logs):

image

hpooja11 commented 11 months ago

I'm experiencing the same issue. @xianyuanliu did you find any work around?