本文主要是介绍Openpose 单个GPU训练起来了。,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
前几天公司有人脸识别方面性能需求,花了点时间,把insightface 的环境安装后训练了一下。
ubuntu单GPU,rtx2080 这样的配置run insightface太慢,当时没记训练速度,大概是1个晚上训练出来10个epoch,达到》95%精度。开发到AI架构是MxNET(这个架构是华人大神李沐和陈天奇等搞得),,估计训练时间久一些,会轻松达到>99%精度,根据论文介绍,目前insightface是人脸领域的SOTA。 后面由于公司对人体姿态动作预测有性能要求,所以花费了几天的时间在1GPU的环境,搭建起来了openpose训练环境。
openpose,COCO数据集体,下载39G的数据,然后生成189G的数据集,训练了一个晚上,,,1路rtx2080,,batch size 8,大概是12小时训练到3个epoch,50000个iter。loss还比较大。。。根据论文作者描述,openpose至少要4路gpu,训练到800k个iter的时候效果是最好的。。。好吧,需要更高的训练工作站更强配置的gpu然后再来做性能提升。
--------------------------------------------------------
https://github.com/CMU-Perceptual-Computing-Lab/openpose/
按照作者的指导,如下:
Training Steps
- Run
cd training; bash getData.sh
to obtain the COCO images indataset/COCO/images/
, keypoints annotations indataset/COCO/annotations/
and COCO official toolbox indataset/COCO/coco/
.- 这里建议开screen,因为要下载超级久
- Run
getANNO.m
in matlab to convert the annotation format from json to mat indataset/COCO/mat/
. - Run
genCOCOMask.m
in matlab to obatin the mask images for unlabeled person. You can use 'parfor' in matlab to speed up the code.- 注意修改Matlab程序中的路径,在 im = imread(['dataset/COCO/', img_paths]);的COCO后面加上images/,原程序有点问题
- 这里尝试开启了一下并行运算,速度特别快,将代码中第二个for循环改为parfor i = 1:L,然后使用Matlab的时候,先输入matlabpool open,然后再运行程序。关闭的方法为matlabpool close
- Run
genJSON('COCO')
to generate a json file indataset/COCO/json/
folder. The json files contain raw informations needed for training. - Run
python genLMDB.py
to generate your LMDB. (You can also download our LMDB for the COCO dataset (189GB file) by:bash get_lmdb.sh
) - Download our modified caffe: caffe_train. Compile pycaffe. It will be merged with caffe_rtpose (for testing) soon.
- Run
python setLayers.py --exp 1
to generate the prototxt and shell file for training. - Download VGG-19 model, we use it to initialize the first 10 layers for training.
- Run
bash train_pose.sh 0,1
(generated by setLayers.py) to start the training with two gpus. ,,当只有1个gpu到时候,后面只给参数0 。
后面继续搞清楚自己收集到的图片如何制作为标签丢到数据集里面,作相应的增强。
这篇关于Openpose 单个GPU训练起来了。的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!