ubicomplab / rPPG-Toolbox

rPPG-Toolbox: Deep Remote PPG Toolbox (NeurIPS 2023)
https://arxiv.org/abs/2210.00716
Other
482 stars 117 forks source link

RuntimeError: Trying to resize storage that is not resizable #176

Closed VikashPR closed 1 year ago

VikashPR commented 1 year ago

Error While running the below command

Command executed in terminal

python main.py --config_file ./configs/infer_configs/PURE_UBFC-rPPG_EFFICIENTPHYS.yaml

Terminal output

=> Merging a config file from ./configs/infer_configs/PURE_UBFC-rPPG_EFFICIENTPHYS.yaml Configuration: => Merging a config file from ./configs/infer_configs/PURE_UBFC-rPPG_EFFICIENTPHYS.yaml Configuration:

BASE: ['']
DEVICE: cpu
INFERENCE:
  BATCH_SIZE: 32
  EVALUATION_METHOD: FFT
  EVALUATION_WINDOW:
    USE_SMALLER_WINDOW: False
    WINDOW_SIZE: 10
  MODEL_PATH: ./final_model_release/PURE_EfficientPhys.pth
LOG:
  PATH: runs/exp/
MODEL:
  BIGSMALL:
    FRAME_DEPTH: 3
  DROP_RATE: 0.2
  EFFICIENTPHYS:
    FRAME_DEPTH: 10
  MODEL_DIR: PreTrainedModels/_SizeW128_SizeH128_ClipLength180_DataType_DataAugNone_LabelType_Crop_faceTrue_Large_boxTrue_Large_size1.5_Dyamic_DetFalse_det_len30_Median_face_boxFalse
  NAME: EfficientPhys
  PHYSNET:
    FRAME_NUM: 64
  RESUME: 
  TSCAN:
    FRAME_DEPTH: 10
NUM_OF_GPU_TRAIN: 1
TEST:
  DATA:
    BEGIN: 0.0
    CACHED_PATH: PreprocessedData/UBFC-rPPG_SizeW72_SizeH72_ClipLength180_DataTypeStandardized_DataAugNone_LabelTypeDiffNormalized_Crop_faceTrue_Large_boxTrue_Large_size1.5_Dyamic_DetFalse_det_len30_Median_face_boxTrue
    DATASET: UBFC-rPPG
    DATA_FORMAT: NDCHW
    DATA_PATH: RawData
    DO_PREPROCESS: True
    END: 1.0
    EXP_DATA_NAME: UBFC-rPPG_SizeW72_SizeH72_ClipLength180_DataTypeStandardized_DataAugNone_LabelTypeDiffNormalized_Crop_faceTrue_Large_boxTrue_Large_size1.5_Dyamic_DetFalse_det_len30_Median_face_boxTrue
    FILE_LIST_PATH: PreprocessedData/DataFileLists/UBFC-rPPG_SizeW72_SizeH72_ClipLength180_DataTypeStandardized_DataAugNone_LabelTypeDiffNormalized_Crop_faceTrue_Large_boxTrue_Large_size1.5_Dyamic_DetFalse_det_len30_Median_face_boxTrue_0.0_1.0.csv
    FILTERING:
      EXCLUSION_LIST: ['']
      SELECT_TASKS: False
      TASK_LIST: ['']
      USE_EXCLUSION_LIST: False
    FOLD:
      FOLD_NAME: 
      FOLD_PATH: 
    FS: 30
    INFO:
      EXERCISE: [True]
      GENDER: ['']
      GLASSER: [True]
      HAIR_COVER: [True]
      LIGHT: ['']
      MAKEUP: [True]
      MOTION: ['']
      SKIN_COLOR: [1]
    PREPROCESS:
      BIGSMALL:
        BIG_DATA_TYPE: ['']
        RESIZE:
          BIG_H: 144
          BIG_W: 144
          SMALL_H: 9
          SMALL_W: 9
        SMALL_DATA_TYPE: ['']
      CHUNK_LENGTH: 180
      CROP_FACE:
        DETECTION:
          DO_DYNAMIC_DETECTION: False
          DYNAMIC_DETECTION_FREQUENCY: 30
          USE_MEDIAN_FACE_BOX: True
        DO_CROP_FACE: True
        LARGE_BOX_COEF: 1.5
        USE_LARGE_FACE_BOX: True
      DATA_AUG: ['None']
      DATA_TYPE: ['Standardized']
      DO_CHUNK: True
      LABEL_TYPE: DiffNormalized
      RESIZE:
        H: 72
        W: 72
      USE_PSUEDO_PPG_LABEL: False
  METRICS: ['MAE', 'RMSE', 'MAPE', 'Pearson', 'SNR']
  USE_LAST_EPOCH: True
TOOLBOX_MODE: only_test
TRAIN:
  BATCH_SIZE: 4
  DATA:
    BEGIN: 0.0
    CACHED_PATH: PreprocessedData/_SizeW128_SizeH128_ClipLength180_DataType_DataAugNone_LabelType_Crop_faceTrue_Large_boxTrue_Large_size1.5_Dyamic_DetFalse_det_len30_Median_face_boxFalse
    DATASET: 
    DATA_FORMAT: NDCHW
    DATA_PATH: 
    DO_PREPROCESS: False
    END: 1.0
    EXP_DATA_NAME: _SizeW128_SizeH128_ClipLength180_DataType_DataAugNone_LabelType_Crop_faceTrue_Large_boxTrue_Large_size1.5_Dyamic_DetFalse_det_len30_Median_face_boxFalse
    FILE_LIST_PATH: PreprocessedData/DataFileLists/_SizeW128_SizeH128_ClipLength180_DataType_DataAugNone_LabelType_Crop_faceTrue_Large_boxTrue_Large_size1.5_Dyamic_DetFalse_det_len30_Median_face_boxFalse_0.0_1.0.csv
    FILTERING:
      EXCLUSION_LIST: ['']
      SELECT_TASKS: False
      TASK_LIST: ['']
      USE_EXCLUSION_LIST: False
    FOLD:
      FOLD_NAME: 
      FOLD_PATH: 
    FS: 0
    INFO:
      EXERCISE: [True]
      GENDER: ['']
      GLASSER: [True]
      HAIR_COVER: [True]
      LIGHT: ['']
      MAKEUP: [True]
      MOTION: ['']
      SKIN_COLOR: [1]
    PREPROCESS:
      BIGSMALL:
        BIG_DATA_TYPE: ['']
        RESIZE:
          BIG_H: 144
          BIG_W: 144
          SMALL_H: 9
          SMALL_W: 9
        SMALL_DATA_TYPE: ['']
      CHUNK_LENGTH: 180
      CROP_FACE:
        DETECTION:
          DO_DYNAMIC_DETECTION: False
          DYNAMIC_DETECTION_FREQUENCY: 30
          USE_MEDIAN_FACE_BOX: False
        DO_CROP_FACE: True
        LARGE_BOX_COEF: 1.5
        USE_LARGE_FACE_BOX: True
      DATA_AUG: ['None']
      DATA_TYPE: ['']
      DO_CHUNK: True
      LABEL_TYPE: 
      RESIZE:
        H: 128
        W: 128
      USE_PSUEDO_PPG_LABEL: False
  EPOCHS: 50
  LR: 0.0001
  MODEL_FILE_NAME: 
  OPTIMIZER:
    BETAS: (0.9, 0.999)
    EPS: 0.0001
    MOMENTUM: 0.9
UNSUPERVISED:
  DATA:
    BEGIN: 0.0
    CACHED_PATH: PreprocessedData/_SizeW128_SizeH128_ClipLength180_DataType_DataAugNone_LabelType_Crop_faceTrue_Large_boxTrue_Large_size1.5_Dyamic_DetFalse_det_len30_Median_face_boxFalse_unsupervised
    DATASET: 
    DATA_FORMAT: NDCHW
    DATA_PATH: 
    DO_PREPROCESS: False
    END: 1.0
    EXP_DATA_NAME: _SizeW128_SizeH128_ClipLength180_DataType_DataAugNone_LabelType_Crop_faceTrue_Large_boxTrue_Large_size1.5_Dyamic_DetFalse_det_len30_Median_face_boxFalse_unsupervised
    FILE_LIST_PATH: PreprocessedData/DataFileLists/_SizeW128_SizeH128_ClipLength180_DataType_DataAugNone_LabelType_Crop_faceTrue_Large_boxTrue_Large_size1.5_Dyamic_DetFalse_det_len30_Median_face_boxFalse_unsupervised_0.0_1.0.csv
    FILTERING:
      EXCLUSION_LIST: ['']
      SELECT_TASKS: False
      TASK_LIST: ['']
      USE_EXCLUSION_LIST: False
    FOLD:
      FOLD_NAME: 
      FOLD_PATH: 
    FS: 0
    INFO:
      EXERCISE: [True]
      GENDER: ['']
      GLASSER: [True]
      HAIR_COVER: [True]
      LIGHT: ['']
      MAKEUP: [True]
      MOTION: ['']
      SKIN_COLOR: [1]
    PREPROCESS:
      CHUNK_LENGTH: 180
      CROP_FACE:
        DETECTION:
          DO_DYNAMIC_DETECTION: False
          DYNAMIC_DETECTION_FREQUENCY: 30
          USE_MEDIAN_FACE_BOX: False
        DO_CROP_FACE: True
        LARGE_BOX_COEF: 1.5
        USE_LARGE_FACE_BOX: True
      DATA_AUG: ['None']
      DATA_TYPE: ['']
      DO_CHUNK: True
      LABEL_TYPE: 
      RESIZE:
        H: 128
        W: 128
      USE_PSUEDO_PPG_LABEL: False
  METHOD: []
  METRICS: []
VALID:
  DATA:
    BEGIN: 0.0
    CACHED_PATH: PreprocessedData
    DATASET: 
    DATA_FORMAT: NDCHW
    DATA_PATH: 
    DO_PREPROCESS: False
    END: 1.0
    EXP_DATA_NAME: 
    FILE_LIST_PATH: PreprocessedData/DataFileLists
    FILTERING:
      EXCLUSION_LIST: ['']
      SELECT_TASKS: False
      TASK_LIST: ['']
      USE_EXCLUSION_LIST: False
    FOLD:
      FOLD_NAME: 
      FOLD_PATH: 
    FS: 0
    INFO:
      EXERCISE: [True]
      GENDER: ['']
      GLASSER: [True]
      HAIR_COVER: [True]
      LIGHT: ['']
      MAKEUP: [True]
      MOTION: ['']
      SKIN_COLOR: [1]
    PREPROCESS:
      BIGSMALL:
        BIG_DATA_TYPE: ['']
        RESIZE:
          BIG_H: 144
          BIG_W: 144
          SMALL_H: 9
          SMALL_W: 9
        SMALL_DATA_TYPE: ['']
      CHUNK_LENGTH: 180
      CROP_FACE:
        DETECTION:
          DO_DYNAMIC_DETECTION: False
          DYNAMIC_DETECTION_FREQUENCY: 30
          USE_MEDIAN_FACE_BOX: False
        DO_CROP_FACE: True
        LARGE_BOX_COEF: 1.5
        USE_LARGE_FACE_BOX: True
      DATA_AUG: ['None']
      DATA_TYPE: ['']
      DO_CHUNK: True
      LABEL_TYPE: 
      RESIZE:
        H: 128
        W: 128
      USE_PSUEDO_PPG_LABEL: False

Initializing UBFC-rPPG dataset... data_path: RawData Preprocessing dataset... 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [01:07<00:00, 33.54s/it] Total Number of raw files preprocessed: 2

Cached Data Path PreprocessedData/UBFC-rPPG_SizeW72_SizeH72_ClipLength180_DataTypeStandardized_DataAugNone_LabelTypeDiffNormalized_Crop_faceTrue_Large_boxTrue_Large_size1.5_Dyamic_DetFalse_det_len30_Median_face_boxTrue

File List Path PreprocessedData/DataFileLists/UBFC-rPPG_SizeW72_SizeH72_ClipLength180_DataTypeStandardized_DataAugNone_LabelTypeDiffNormalized_Crop_faceTrue_Large_boxTrue_Large_size1.5_Dyamic_DetFalse_det_len30_Median_face_boxTrue_0.0_1.0.csv test Preprocessed Dataset Length: 18

===Testing=== Testing uses pretrained model! Traceback (most recent call last): File "main.py", line 288, in test(config, data_loader_dict) File "main.py", line 95, in test model_trainer.test(data_loader_dict) File "/Users/vikashpr/Dev/Python/rPPG-Toolbox/neuralmethods/trainer/EfficientPhysTrainer.py", line 171, in test for , test_batch in enumerate(data_loader['test']): File "/Users/vikashpr/anaconda3/envs/rpg-toolbox/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 633, in next data = self._next_data() File "/Users/vikashpr/anaconda3/envs/rpg-toolbox/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1345, in _next_data return self._process_data(data) File "/Users/vikashpr/anaconda3/envs/rpg-toolbox/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1371, in _process_data data.reraise() File "/Users/vikashpr/anaconda3/envs/rpg-toolbox/lib/python3.8/site-packages/torch/_utils.py", line 644, in reraise raise exception RuntimeError: Caught RuntimeError in DataLoader worker process 0. Original Traceback (most recent call last): File "/Users/vikashpr/anaconda3/envs/rpg-toolbox/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 308, in _worker_loop data = fetcher.fetch(index) File "/Users/vikashpr/anaconda3/envs/rpg-toolbox/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 54, in fetch return self.collate_fn(data) File "/Users/vikashpr/anaconda3/envs/rpg-toolbox/lib/python3.8/site-packages/torch/utils/data/_utils/collate.py", line 265, in default_collate return collate(batch, collate_fn_map=default_collate_fn_map) File "/Users/vikashpr/anaconda3/envs/rpg-toolbox/lib/python3.8/site-packages/torch/utils/data/_utils/collate.py", line 142, in collate return [collate(samples, collate_fn_map=collate_fn_map) for samples in transposed] # Backwards compatibility. File "/Users/vikashpr/anaconda3/envs/rpg-toolbox/lib/python3.8/site-packages/torch/utils/data/_utils/collate.py", line 142, in return [collate(samples, collate_fn_map=collate_fn_map) for samples in transposed] # Backwards compatibility. File "/Users/vikashpr/anaconda3/envs/rpg-toolbox/lib/python3.8/site-packages/torch/utils/data/_utils/collate.py", line 119, in collate return collate_fn_map[elem_type](batch, collate_fn_map=collate_fn_map) File "/Users/vikashpr/anaconda3/envs/rpg-toolbox/lib/python3.8/site-packages/torch/utils/data/_utils/collate.py", line 171, in collate_numpy_array_fn return collate([torch.as_tensor(b) for b in batch], collate_fn_map=collate_fn_map) File "/Users/vikashpr/anaconda3/envs/rpg-toolbox/lib/python3.8/site-packages/torch/utils/data/_utils/collate.py", line 119, in collate return collate_fn_map[elem_type](batch, collate_fn_map=collate_fn_map) File "/Users/vikashpr/anaconda3/envs/rpg-toolbox/lib/python3.8/site-packages/torch/utils/data/_utils/collate.py", line 161, in collate_tensorfn out = elem.new(storage).resize(len(batch), *list(elem.size())) RuntimeError: Trying to resize storage that is not resizable

I am using MacBook Air 2017 i5 5th generation. My system don't have CUDA. Please help me resolve this error.

VikashPR commented 1 year ago

This is the fork of the rPPG-Toolkit which I am using. https://github.com/VikashPR/rPPG-Toolbox

I want to run execute EfficientPhys algorithm with UBFC datasets and with our custom datasets for research purpose.

yahskapar commented 1 year ago

Hi @VikashPR,

I believe you have figured out what the issue was in your case based on recent commits to your fork that you linked. As a result, I'll close this issue and note that the current iteration of the toolbox does not support CPU-only training or inference of any kind. We plan to support CPU-only inference in the near future, and possibly CPU-only training though I personally think that will be much, much less likely due to its lack of value to the research community at large which typically improves the state-of-the-art using GPUs and deep learning techniques.