Stacked_Hourglass_Network_Keras icon indicating copy to clipboard operation
Stacked_Hourglass_Network_Keras copied to clipboard

batch size 2

Open MetaDev opened this issue 6 years ago • 6 comments

Can you explain why you have such a small batch size in the training command please? thanks

MetaDev avatar Oct 21 '18 11:10 MetaDev

The provided commands just show how to use the 'train.py'. Actually, i used batch_size 24 in my expriments. Thank you for pointing it out. I will made the change on readme to avoid confusing.

yuanyuanli85 avatar Oct 22 '18 01:10 yuanyuanli85

When I use batch_size of 10 I already get an out of memory error (on a GOU with 8 GB). Can you explain why each sample takes up so much space? I can't figure it out, it seems to me that each sample is only 1*inres+ (14 *n_stacks)*outres big. Or is there something wrong with my reasoning.

On Mon, Oct 22, 2018 at 3:02 AM VictorLi [email protected] wrote:

The provided commands just show how to use the 'train.py'. Actually, i used batch_size 24 in my expriments. Thank you for pointing it out. I will made the change on readme to avoid confusing.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/yuanyuanli85/Stacked_Hourglass_Network_Keras/issues/7#issuecomment-431719935, or mute the thread https://github.com/notifications/unsubscribe-auth/AG5qEA2dW4ql7-IzguH3uQuqUV_bFx5-ks5unRkjgaJpZM4XyaGB .

MetaDev avatar Oct 22 '18 16:10 MetaDev

The training took much more memory than the input & output memory due to the forward/backward of each layer. If you want to avoid out-of-memory issue, you can try to decrease inres or stack number or batch_size.

yuanyuanli85 avatar Oct 23 '18 00:10 yuanyuanli85

"due to the forward/backward of each layer" what do you mean by "layer" here, is it 1 hourglass stack or one bottleneck block or something else? Because I have trained other networks with 100's of images in a batch (not in keras though, I used pytorch). Is there a way to print the memory size in megabytes of a batch? Thanks!

On Tue, Oct 23, 2018 at 2:04 AM VictorLi [email protected] wrote:

The training took much more memory than the input & output memory due to the forward/backward of each layer. If you want to avoid out-of-memory issue, you can try to decrease inres or stack number or batch_size.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/yuanyuanli85/Stacked_Hourglass_Network_Keras/issues/7#issuecomment-432034442, or mute the thread https://github.com/notifications/unsubscribe-auth/AG5qEFyTmPKLa71E3uWLTiA-Tkzsra9pks5unl0mgaJpZM4XyaGB .

MetaDev avatar Oct 23 '18 15:10 MetaDev

Also, in the validation callback here,

https://github.com/yuanyuanli85/Stacked_Hourglass_Network_Keras/blob/eddf0ae15715a88d7859847cfff5f5092b260ae1/src/eval/eval_callback.py#L29

Shouldn't it be valdata.generator(batch_size, **2**, sigma=2, is_shuffle=False, with_meta=True): Doesn't 8 mean the numstacks are being set incorrectly.

pavan4 avatar Mar 11 '19 10:03 pavan4

@pavan4 In eval_callback.py, the number of stackes in generator does not matter because the _gthmap not used during validation. Instead, we use the ground truth infor in _meta to get score.

yuanyuanli85 avatar Mar 14 '19 08:03 yuanyuanli85