posec3D训练自己的模型

官方例子:

./tools/dist_train.sh configs/recognition/tsn/tsn_r50_1x1x3_100e_kinetics400_rgb.py 8 --resume-from work_dirs/tsn_r50_1x1x3_100e_kinetics400_rgb/latest.pth

我们这里修改为load-from
Difference between resume-from and load-from: resume-from loads both the model weights and optimizer status, and the epoch is also inherited from the specified checkpoint. It is usually used for resuming the training process that is interrupted accidentally. load-from only loads the model weights and the training epoch starts from 0. It is usually used for finetuning.
下载训练数据集
https://github.com/open-mmlab/mmaction2/tree/master/tools/data/skeleton
放在data/posec3d下面

./tools/dist_train.sh configs/skeleton/posec3d/slowonly_r50_u48_240e_ntu120_xsub_keypoint.py 1 --resume-from work_dirs/slowonly_r50_u48_240e_ntu120_xsub_keypoint-6736b03f.pth

python tools/train.py configs/skeleton/posec3d/slowonly_r50_u48_240e_ntu120_xsub_keypoint.py     --work-dir work_dirs/slowonly_r50_u48_240e_xsub_keypoint     --validate --seed 0 --deterministic
``

这里训练就跑通了,注意提示我们要修改一下参数
train.py171行添加

cfg.gpu_ids = [0]

mmaction/apis/train.py 91行

# num_gpus=len(cfg.gpu_ids),
        num_gpus=1,

当然如果我们要修改数据集,参考如何生成pkl文件

微调模型参考链接这里介绍如何将NTU RGB+D原始数据转化为MMAction2格式。首先,需要从https://github.com/shahroudy/NTURGB-D下载原始NTU-RGBD 60和NTU-RGBD 120数据调色的原型馃。

https://github.com/open-mmlab/mmaction2/blob/master/docs/en/tutorials/2_finetune.md

微调模型我们要修改head

你可能感兴趣的:(python,深度学习,机器学习)