Here, we transfer the vclr weights format to mmaction2 format through three steps:
Follow the below command to download the template weight files:
cd ~/VCLR/weights
wget https://haofeik-data.s3.amazonaws.com/VCLR/mm_templates/mm_tsn_template.pth
wget https://haofeik-data.s3.amazonaws.com/VCLR/mm_templates/mm_tsm_template.pth
For example, vclr weights path is vclr_k400.pth
, and mmaction2 template weights path is mm_tsn_template.pth
and mm_tsm_template.pth
-
transfer weights for mmaction2 TSN model:
python vclr2mm.py --mm-weights mm_tsn_template.pth --vclr-weights vclr_k400.pth
-
transfer weights for mmaction2 TSM model:
python vclr2mm.py --mm-weights mm_tsm_template.pth --vclr-weights vclr_k400.pth --tsm
The transfered weights vclr_mm.pth
or vclr_mm_tsm.pth
will be stored at the same directory.
Most applications will use the ResNet-50 through torchvision, you can follow commands below to transfer VCLR pretrained weights to torchvision format.
For example, vclr weights path is vclr_k400.pth
,
python vclr2torchvision.py --vclr-weights vclr_k400.pth
The transfered weights vclr_torch.pth
will be stored at the same directory.