jwyang / faster-rcnn.pytorch

A faster pytorch implementation of faster r-cnn
MIT License
7.69k stars 2.33k forks source link

can i change the __C.TRAIN.RPN_BATCHSIZE = 256 ? #761

Open devendraswamy opened 4 years ago

loolzaaa commented 4 years ago

I think yes. This number = maximum proposals (foreground + background) in anchor target layer, but change this parameter didn't get significant improvement of net metrics for me.

Also, look at the __C.TRAIN.RPN_FG_FRACTION parameter (default = 0.5).

devendraswamy commented 4 years ago

Thank you for the valuable information , one more doubt can i change this parameter in config.py ?

Minibatch size (number of regions of interest [ROIs])

-- __C.TRAIN.BATCH_SIZE = 128

devendraswamy commented 4 years ago

Actually my problem is , when i given the large dataset to model then my system was restarted , so i want to reduce the data-loading ?

loolzaaa commented 4 years ago

an i change this parameter in config.py ? __C.TRAIN.BATCH_SIZE = 128

This parameter = maximum proposals (foreground + background) in proposal target layer. Also, there is fraction for it.

Actually my problem is , when i given the large dataset to model then my system was restarted , so i want to reduce the data-loading ?

What you mean, when say "large dataset"?

Parameters above are not responsible for dataset or batch size for model. Actually:

devendraswamy commented 4 years ago

Thank you but could you please tell me the reason for system restarting ?

loolzaaa commented 4 years ago

Is there some trigger for restarting? High temperature of CPU of GPU? If you see BSOD before reboot, this can be RAM problem.

Need more info about your situation.

In which cases you system is going to reboot, in which not...

devendraswamy commented 4 years ago

when I am given large data to model then that time that will restarted and model working fine for less data. I am successfully train the model with pascal and coco datsets and custom data also.

loolzaaa commented 4 years ago

I am successfully train the model with pascal and coco datsets and custom data also.

COCO dataset successfully trained? Then what do you mean when say "large data"? Many pictures? Big resolution of pictures... etc...?

devendraswamy commented 4 years ago

I mean that will restart when I am giving my own dataset ( more images as compared to coco)

On Tue 25 Feb, 2020, 19:36 loolzaaa, notifications@github.com wrote:

I am successfully train the model with pascal and coco datsets and custom data also.

COCO dataset successfully trained? Then what do you mean when say "large data"? Many pictures? Big resolution of pictures... etc...?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jwyang/faster-rcnn.pytorch/issues/761?email_source=notifications&email_token=ALLD6LURE5WB36SC2CB7MT3REUQWVA5CNFSM4KXDJRCKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEM4CTIY#issuecomment-590883235, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALLD6LWYEUP46YWHRCNLYZDREUQWVANCNFSM4KXDJRCA .

loolzaaa commented 4 years ago

You need to check GPU/RAM memory while training (before reboot).

Try to increase RAM swap file size.

devendraswamy commented 4 years ago

Thank you for your suggestion , I will check it and let you know.

On Tue 25 Feb, 2020, 21:34 loolzaaa, notifications@github.com wrote:

You need to check GPU/RAM memory while training (before reboot).

Try to increase RAM swap file size.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jwyang/faster-rcnn.pytorch/issues/761?email_source=notifications&email_token=ALLD6LTLQCCNHE2GTZONSTLREU6QDA5CNFSM4KXDJRCKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEM4RFSY#issuecomment-590942923, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALLD6LVALRPUNF7FY4SYB5DREU6QDANCNFSM4KXDJRCA .

devendraswamy commented 4 years ago

Hi.. one more help ,I want to decrease the loss of the model , so which parameters i have to change ?

loolzaaa commented 4 years ago

Loss of the model is the main indicator, almost all parameters can increase or decrease loss.

If you talk about train this network on default datasets like voc or coco then cfg from lib is the best choice, no need to change something.

If you talk about train this network on custom dataset then look into optimizer parameters (lr, weight decay). Also, look into learning rate annealing (decrease LR every X epochs - adjust_learning_rate method). NMS parameters also may affect on loss. Try to change RPN anchors and RATIOS to another value.

Anyway, you need some metrics to rate success of your model, not only loss.

devendraswamy commented 4 years ago

THANK YOU , and Why coco using four anchor boxes[4,8,16,32], could you provide good documentation for FRCNN model ?

loolzaaa commented 4 years ago

Why coco using four anchor boxes[4,8,16,32]

More image size need more different anchors

could you provide good documentation for FRCNN model ?

Blog from ankur6ue

devendraswamy commented 4 years ago

Thank you !

devendraswamy commented 4 years ago

Hi..

In this project , max gt boxes = 20 for pascal_voc and max gt boxes = 50 for coco. can i change that one because in my data max bounding boxes for one image is 270(approximately equal to 270).

please help , Thank you in advance.

loolzaaa commented 4 years ago

Yes, you can change it. Also, if you know maximum size of bounding box, may be you want to change RATIOS and SCALES for anchor generation layer.

devendraswamy commented 4 years ago

How can I calculated that one ?

On Tue 3 Mar, 2020, 20:00 loolzaaa, notifications@github.com wrote:

Yes, you can change it. Also, if you know maximum size of bounding box, may be you want to change RATIOS and SCALES for anchor generation layer.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jwyang/faster-rcnn.pytorch/issues/761?email_source=notifications&email_token=ALLD6LUIHXTTC6DMOGIIF2DRFUIB7A5CNFSM4KXDJRCKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENTWTVA#issuecomment-593979860, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALLD6LUUIHU247EUD2I3KGDRFUIB7ANCNFSM4KXDJRCA .

devendraswamy commented 4 years ago

I thought my data will had max gt bounding boxes size is 270.

On Tue 3 Mar, 2020, 20:17 REVU DEVENDRASWAMY, revudevendraswamy@gmail.com wrote:

How can I calculated that one ?

On Tue 3 Mar, 2020, 20:00 loolzaaa, notifications@github.com wrote:

Yes, you can change it. Also, if you know maximum size of bounding box, may be you want to change RATIOS and SCALES for anchor generation layer.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jwyang/faster-rcnn.pytorch/issues/761?email_source=notifications&email_token=ALLD6LUIHXTTC6DMOGIIF2DRFUIB7A5CNFSM4KXDJRCKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENTWTVA#issuecomment-593979860, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALLD6LUUIHU247EUD2I3KGDRFUIB7ANCNFSM4KXDJRCA .

loolzaaa commented 4 years ago

Hmm... some confusion... max gt boxes parameter = maximum number of ground-truth boxes per image, NOT size of boxes.

devendraswamy commented 4 years ago

Sry .... Yes my images had max no of gt boxes are 270.

On Tue 3 Mar, 2020, 20:23 loolzaaa, notifications@github.com wrote:

Hmm... some confusion... max gt boxes parameter = maximum number of ground-truth boxes per image, NOT size of boxes.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jwyang/faster-rcnn.pytorch/issues/761?email_source=notifications&email_token=ALLD6LQZK6F6OLDZPMZOVYLRFUKV5A5CNFSM4KXDJRCKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENTZKYQ#issuecomment-593991010, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALLD6LSM7XNIILJKOPHWYJ3RFUKV5ANCNFSM4KXDJRCA .

devendraswamy commented 4 years ago

any calculations for changing anchor box scales and anchor ratios ? how can i define those parameters based upon data ?

loolzaaa commented 4 years ago

You need to read manual carefully, especially "anchor generation layer" part.

devendraswamy commented 4 years ago

Thank you so much