Variations-of-SFANet-for-Crowd-Counting icon indicating copy to clipboard operation
Variations-of-SFANet-for-Crowd-Counting copied to clipboard

Train detail?

Open niepei opened this issue 4 years ago • 6 comments

I have trained 1000 epoche in shanghaiTech part A samples using the M_SFANet,but the test mea is 68.08,the learning rate used 5e-4, the batch size used 8, and the sample size croped as 400*400. And can you tell me the train detail?

niepei avatar Feb 07 '21 08:02 niepei

Do you use the training preprocessing (for SHA) as employed in the Training details section of SFANet paper (https://arxiv.org/pdf/1902.01115.pdf). And also, in my experiments, I used ADAM with lookahead (https://arxiv.org/abs/1907.08610, See https://github.com/rwightman/pytorch-image-models/blob/master/timm/optim/lookahead.py for the implementation). You can also play with the learning rate (5e-4, 6e-4, ...).

Pongpisit-Thanasutives avatar Feb 10 '21 04:02 Pongpisit-Thanasutives

how could you set crop size to 400x400 when i process the shha data according to the bayesian code, erroe happen like this : File "/home/../.jupyter/Variations-of-SFANet-for-Crowd-Counting-master/datasets/crowd.py", line 91, in train_transform │················· assert st_size >= self.c_size │················· AssertionError
only when i set the crop size to 256( other setiings like yours ),the code could run,but the test mae is only 73.6, far from the paper record. and i was strcucked about the min_size and max_size in the bayesian_preprocess_sh.py(shha setting is min_size = 256, max_size = 5096

knightyxp avatar Mar 06 '21 14:03 knightyxp

I have trained 1000 epoche in shanghaiTech part A samples using the M_SFANet,but the test mea is 68.08,the learning rate used 5e-4, the batch size used 8, and the sample size croped as 400*400. And can you tell me the train detail?

how could you set crop size to 400x400 when i process the shha data according to the bayesian code, erroe happen like this : File "/home/../.jupyter/Variations-of-SFANet-for-Crowd-Counting-master/datasets/crowd.py", line 91, in train_transform │················· assert st_size >= self.c_size │················· AssertionError only when i set the crop size to 256( other setiings like yours ),the code could run,but the test mae is only 73.6, far from the paper record. and i was strcucked about the min_size and max_size in the bayesian_preprocess_sh.py(shha setting is min_size = 256, max_size = 5096

knightyxp avatar Mar 06 '21 14:03 knightyxp

Just to clarify some points, (1) The purpose of "bayesian_preprocess_sh.py" is for fine-tuning the models which are pretrained on UCF_QNRF. So, the crop size should be 256x256 rather than 400x400 if you are using (fine-tuning) "bayesian_preprocess_sh.py" according to their paper (https://openaccess.thecvf.com/content_ICCV_2019/papers/Ma_Bayesian_Loss_for_Crowd_Count_Estimation_With_Point_Supervision_ICCV_2019_paper.pdf).

(2) If you are training from scratch, the crop size is 400x400 and please refer to the SHA preprocessing code here => https://github.com/pxq0312/SFANet-crowd-counting/blob/master/transforms.py.

Pongpisit-Thanasutives avatar Mar 06 '21 17:03 Pongpisit-Thanasutives

3qu for clarification, another problem is how to get the average prediction of two models(M-segNet and M-sfanet),just to train the two model on the same dataset and average the prediction to get the final attracting results?

knightyxp avatar Mar 10 '21 07:03 knightyxp

3qu for clarification, another problem is how to get the average prediction of two models(M-segNet and M-sfanet),just to train the two model on the same dataset and average the prediction to get the final attracting results?

Yes!, We used simple averaging model predictions.

Pongpisit-Thanasutives avatar Mar 11 '21 09:03 Pongpisit-Thanasutives