WongKinYiu / PartialResidualNetworks

partial residual networks
100 stars 24 forks source link

Training YOLOv3-Tiny-PRN #7

Open Arcitec opened 4 years ago

Arcitec commented 4 years ago

Hi!

The PRN models has more layers (shortcut layers). How many layers should we extract from weights when training?

Still 15 layers, like for regular YOLOV3-Tiny? https://github.com/AlexeyAB/darknet#how-to-train-tiny-yolo-to-detect-your-custom-objects (Edit: I see you said 15 layers here https://github.com/AlexeyAB/darknet/issues/4091#issuecomment-542513900 so I guess we extract 15?)

Also, if we want to fix the mask problem (https://github.com/WongKinYiu/PartialResidualNetworks/issues/2) to 0,1,2, is it enough for us to extract X layers from weights, fix the config, and do transfer-learning on our own custom dataset? Or does it need a full re-training on COCO with the new config?

WongKinYiu commented 4 years ago

yes, still 15, shortcut layer do not have weights. if u want to using mask = 0,1,2, i think re-train coco with same setting for transfer learning will be slightly better.

however, for coco dataset, i use same imagenet pre-trained model, mask = 1,2,3 get better than mask = 0,1,2.

Arcitec commented 4 years ago

yes, still 15, shortcut layer do not have weights.

Oh okay, that makes sense. Thank you! I've trained the data now and presented the results! <3 https://github.com/opencv/opencv/pull/15739#issuecomment-544931445

if u want to using mask = 0,1,2, i think re-train coco with same setting for transfer learning will be slightly better.

Yes probably better.

however, for coco dataset, i use same imagenet pre-trained model, mask = 1,2,3 get better than mask = 0,1,2.

Have you trained COCO 0,1,2 and 1,2,3 weights? Or only trained COCO 1,2,3 weights?

If you have trained COCO weights on both values, I'd love to hear about what you did and what the results were.

WongKinYiu commented 4 years ago

yes, i have trained both of 0,1,2 and 1,2,3 on coco. codalab was dead few month ago, so i lost the results of those models.

Arcitec commented 4 years ago

Aw okay. But thanks for clarifying that you have trained 123 too! I'll reply about this in the mask thread, to not split the conversations.

Arcitec commented 4 years ago

Accuracy and speed results:

https://github.com/opencv/opencv/pull/15739#issuecomment-544931445 https://github.com/AlexeyAB/darknet/issues/4091#issuecomment-542513900

Hint for everyone: This PRN network needs more iterations than regular non-PRN versions of YOLO to learn good accuracy. Train train train! If you don't get good mAP, check your amount of training iterations and try more training! For example, YOLOv3-Tiny was at 78% accuracy for a 1-class network after 2000 iterations and 83% after 2500 iterations. YOLOv3-Tiny-PRN was at 73% after 2000 iterations and 80% after 3000 iterations.

tuongtranngoc commented 4 years ago

@WongKinYiu , Can you share pretrained weight of YOLOv3-tiny-PRN? this weight Link not have!

WongKinYiu commented 4 years ago

@NgTuong hello,

u can follow https://github.com/AlexeyAB/darknet#how-to-train-tiny-yolo-to-detect-your-custom-objects to get coco pre-trained model. i m in iccv now, so if u want to use imagenet pre-trained model, i will put it on the github after iccv.

tuongtranngoc commented 4 years ago

@WongKinYiu thank you but i have a problem when training it is stopped training and save model now. Wish you help me? Screenshot_2019-10-29 Google Colaboratory.

WongKinYiu commented 4 years ago

i think u r missing --clear flag.

by the way, using yolov3-tiny.weights as pre-trained model is not the best solution for transfer learning.

tuongtranngoc commented 4 years ago

@WongKinYiu, In this case, what do i? Not use pretrained?

Arcitec commented 4 years ago

In this case, what do i?

https://github.com/WongKinYiu/PartialResidualNetworks/tree/master/model

WongKinYiu commented 4 years ago

@VideoPlayerCode thanks.

tuongtranngoc commented 4 years ago

@VideoPlayerCode , @WongKinYiu , thanks =)

tuongtranngoc commented 4 years ago

@WongKinYiu , why must use --clear flag?

WongKinYiu commented 4 years ago

@NgTuong

becuz there are some logs in the weight file. for example, trained iterations. pretrained model recorded the max iteration, for yolov3 case, it is 500200. however u want to train ur model starts from 0, so u need to use --clear flag.