facebookresearch / SlowFast

PySlowFast: video understanding codebase from FAIR for reproducing state-of-the-art video models.
Apache License 2.0
6.65k stars 1.22k forks source link

Run demo using Kinetic pkl file #279

Closed vipinvijay1986 closed 4 years ago

vipinvijay1986 commented 4 years ago

Hi Team, Thanks for providing updates to run Demo on AVA and KINETIC dataset. But with new updates, I am facing a problem to run Demo with Kinetic pickle file. It says

File "/content/SlowFast/slowfast/utils/checkpoint.py", line 265, in load_checkpoint checkpoint = torch.load(f, map_location="cpu") File "/usr/local/lib/python3.6/dist-packages/torch/serialization.py", line 585, in load return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args) File "/usr/local/lib/python3.6/dist-packages/torch/serialization.py", line 755, in _legacy_load magic_number = pickle_module.load(f, **pickle_load_args) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd4 in position 1: invalid continuation byte

FYR I made the following entries in YAML file (https://github.com/facebookresearch/SlowFast/blob/master/demo/Kinetics/SLOWFAST_8x8_R50.yaml)

TRAIN:
  CHECKPOINT_FILE_PATH: ./demo/Kinetics/SLOWFAST_8x8_R50.pkl #from [Link    ](https://dl.fbaipublicfiles.com/pyslowfast/model_zoo/kinetics400/SLOWFAST_8x8_R50.pkl)
DEMO:
  ENABLE: True
  OUTPUT_FILE: ./demo/KidsCycling_output.mp4
  LABEL_FILE_PATH:  ./demo/Kinetics/label.json # Converted {  "abseiling": 0, "air drumming": 1,  "answering questions": 2..}
  INPUT_VIDEO: ./demo/KidsCycling.mp4  # Path to a video file or image folder
  GT_BOXES: ./demo/Kinetics/train.csv # Copied from [Link ](https://storage.googleapis.com/deepmind-media/Datasets/kinetics400.tar.gz)
vipinvijay1986 commented 4 years ago

Hi Team, Got the solution of problem, need to set CHECKPOINT_TYPE: caffe2 in Test configuration. https://github.com/facebookresearch/SlowFast/issues/19