Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to finetune SLOWFAST_8x8_R50_DETECTION.pyth ? #267

Open
sleepyMMp opened this issue Aug 29, 2024 · 1 comment
Open

How to finetune SLOWFAST_8x8_R50_DETECTION.pyth ? #267

sleepyMMp opened this issue Aug 29, 2024 · 1 comment

Comments

@sleepyMMp
Copy link

sleepyMMp commented Aug 29, 2024

❓ Questions on how to use PyTorchVideo

Hi, please help me to fintune SLOWFAST_8x8_R50_DETECTION.pyth which is used in " from pytorchvideo.models.hub import slowfast_r50_detection"
I wrote a yaml for training slowfast_r50_detection based on the conbination of SLOWFAST_32x2_R50_SHORT.yaml and SLOWFAST_8x8_R50.yaml. CHECKPOINT_FILE_PATH use SLOWFAST_8x8_R50_DETECTION.pyth
It can work when I dont use CHECKPOINT_FILE_PATH, however the result cannot be loaded by slowfast_r50_detection()
It doesnt work when I use SLOWFAST_8x8_R50_DETECTION.pyth as CHECKPOINT_FILE_PATH and the error is "RuntimeError: The size of tensor a (2304) must match the size of tensor b (7) at non-singleton dimension 4" Maybe there is something wrong with the configuration, please help me.
Thank You!

Here is my yaml.

TRAIN:
ENABLE: True
DATASET: ava
BATCH_SIZE: 2
EVAL_PERIOD: 1
CHECKPOINT_PERIOD: 1
AUTO_RESUME: True
CHECKPOINT_FILE_PATH: "xxx/SLOWFAST_8x8_R50_DETECTION.pyth"
CHECKPOINT_TYPE: pytorch
DATA:
NUM_FRAMES: 32
SAMPLING_RATE: 2
TRAIN_JITTER_SCALES: [256, 320]
TRAIN_CROP_SIZE: 224
TEST_CROP_SIZE: 256
INPUT_CHANNEL_NUM: [3, 3]
PATH_TO_DATA_DIR: '/data/lijh56/SlowFast-main/dataset/traindata'
DETECTION:
ENABLE: True
ALIGNED: True
AVA:
FRAME_DIR: 'xxxx'
FRAME_LIST_DIR: 'xxxx'
ANNOTATION_DIR: 'xxxx'
DETECTION_SCORE_THRESH: 0.8
TRAIN_PREDICT_BOX_LISTS: [
"ava_train_v2.2.csv",
"person_box_67091280_iou90/ava_detection_train_boxes_and_labels_include_negative_v2.2.csv",
]
TEST_PREDICT_BOX_LISTS: ["person_box_67091280_iou90/ava_detection_val_boxes_and_labels.csv"]

SLOWFAST:
ALPHA: 4
BETA_INV: 8
FUSION_CONV_CHANNEL_RATIO: 2
FUSION_KERNEL_SZ: 7
RESNET:
ZERO_INIT_FINAL_BN: True
WIDTH_PER_GROUP: 64
NUM_GROUPS: 1
DEPTH: 50
TRANS_FUNC: bottleneck_transform
STRIDE_1X1: False
NUM_BLOCK_TEMP_KERNEL: [[3, 3], [4, 4], [6, 6], [3, 3]]
SPATIAL_STRIDES: [[1, 1], [2, 2], [2, 2], [2, 2]]
SPATIAL_DILATIONS: [[1, 1], [1, 1], [1, 1], [1, 1]]
NONLOCAL:
LOCATION: [[[], []], [[], []], [[], []], [[], []]]
GROUP: [[1, 1], [1, 1], [1, 1], [1, 1]]
INSTANTIATION: dot_product
BN:
USE_PRECISE_STATS: False
NUM_BATCHES_PRECISE: 200
SOLVER:
BASE_LR: 0.1
LR_POLICY: steps_with_relative_lrs
STEPS: [0, 10, 15, 20]
LRS: [1, 0.1, 0.01, 0.001]
MAX_EPOCH: 25
MOMENTUM: 0.9
WEIGHT_DECAY: 1e-7
WARMUP_EPOCHS: 5.0
WARMUP_START_LR: 0.000125
OPTIMIZING_METHOD: sgd
MODEL:
NUM_CLASSES: 2
ARCH: slowfast
MODEL_NAME: SlowFast
LOSS_FUNC: bce
DROPOUT_RATE: 0.5
HEAD_ACT: sigmoid
TEST:
ENABLE: False
DATASET: ava
BATCH_SIZE: 8
DATA_LOADER:
NUM_WORKERS: 2
PIN_MEMORY: True
NUM_GPUS: 1
NUM_SHARDS: 1
RNG_SEED: 0
OUTPUT_DIR: "xxxx"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@sleepyMMp and others