mxnet_Realtime_Multi-Person_Pose_Estimation icon indicating copy to clipboard operation
mxnet_Realtime_Multi-Person_Pose_Estimation copied to clipboard

How to use TrainWeight.py?

Open qqsh0214 opened this issue 7 years ago • 8 comments

Hi @dragonfly90 I finish my own data.json for a new dataset according to annotation.ipynb and change GenerateLabelCPM.py to fit the keypoints. I want to use TrainWeight.py to fine tune. But I get the following error: RuntimeError: simple_bind error. Arguments: data: (1, 3, 368, 368) heatmaplabel: (1, 19, 46, 46) heatweight: (1, 19, 46, 46) partaffinityglabel: (1, 38, 46, 46) vecweight: (1, 38, 46, 46) This is caused by File "TrainWeight.py", line 88, in <module> cmodel.fit(cocodata, num_epoch = config.TRAIN.num_epoch, arg_params=arg_params, aux_params=aux_params) File "TrainWeight.py", line 19, in fit ('vecweight',(1,38,46,46))]) I think it may be the shapes are not matched with pre-trained model. So I change my Mydata.json to the previous data.json for COCO. But it still has the same error. Do you know the reason?

Thank you very much!

qqsh0214 avatar Sep 19 '17 06:09 qqsh0214

@qqsh0214, I fix one bug in generating mask(but this should not cause your infer shape error). Could you use the following code to check if you are generating the right heatmap?

https://github.com/dragonfly90/mxnet_Realtime_Multi-Person_Pose_Estimation/blob/master/test_generateLabel.ipynb

Check if heat map, part affinity graph map, mask are generated correctly in training: test_generateLabel.ipynb

dragonfly90 avatar Sep 20 '17 02:09 dragonfly90

@dragonfly90 Thanks for your reply! I have tried your test_generateLabel.ipynb and visualize the heat map and mask. In fact, they are correct. So maybe there is something else causing the infer shape error.

qqsh0214 avatar Sep 20 '17 03:09 qqsh0214

@qqsh0214 I don't know the problem then, I think you should crop the image size to (368, 368).In test_generateLabel.ipynb I checked heatmap, mask but only pafmap is not checked.

dragonfly90 avatar Sep 21 '17 00:09 dragonfly90

@qqsh0214 I update the test_generateLabel.ipynb to check paf map, could you have a look at it?

dragonfly90 avatar Sep 21 '17 01:09 dragonfly90

@dragonfly90 OK, I see. I will try later. Thank you very much!

qqsh0214 avatar Sep 21 '17 01:09 qqsh0214

@qqsh0214 could you clone the new code and change two parts of the code Except that

#COCO_to_ours_1 = [14, 6, 8, 10, 5, 7, 9, 12, 13, 11, 2, 1, 4, 3]
#COCO_to_ours_2 = [14, 6, 8, 10, 5, 7, 9, 12, 13, 11, 2, 1, 4, 3]

You may also need to change

mid_1 = [2, 9, 10, 2, 12, 13, 2, 3, 4, 3, 2, 6, 7, 6, 2, 1, 1, 15, 16]
mid_2 = [9, 10, 11, 12, 13, 14, 3, 4, 5, 17, 6, 7, 8, 18, 1, 15, 16, 17, 18]

dragonfly90 avatar Sep 21 '17 22:09 dragonfly90

@dragonfly90 Thanks. Your new code works without previous error on COCO dataset. I will try to change other parts of the code to fit my own dataset.

qqsh0214 avatar Sep 22 '17 02:09 qqsh0214

@qqsh0214 I fix the error. I will clean the code and talk to you later.

dragonfly90 avatar Sep 22 '17 20:09 dragonfly90