NVlabs / DG-Net

:couple: Joint Discriminative and Generative Learning for Person Re-identification. CVPR'19 (Oral) :couple:
https://www.zdzheng.xyz/publication/Joint-di2019
Other
1.28k stars 228 forks source link

did you resize MSMT17 images to the same size while you training them? #38

Closed yian2271368 closed 4 years ago

yian2271368 commented 4 years ago

hi guys, thanks for your greate contributions. I am just curious while you do the supervised learning for MSMT17 datasets, did you reisze the images to the same size?(since the shape of the images vary in that dataset). If not, how did you deal with that?

layumi commented 4 years ago

@yian2271368 Yes, we resize the image to the same scale for training.

yian2271368 commented 4 years ago

@layumi thanks for replying. I did the same thing, i resized the image to 256*128, but the images just look strange. I guess i will just see how the model work. Thanks for you help!

yian2271368 commented 4 years ago

@layumi hey, sorry to bother you again. I tried to train the teacher model bymyself, following the instructions from another repo. I resized the Images by scales(so they can keep the same height-width ratio), and then pad them to 256*256. The thing is, the PCB model did not converge(I trained 120 epochs, loss keeps around 41). The only thing i changed was that i Put scheduler.step() after optimizer.step(). Do you have any idea about this? here is the train config: python train.py --gpu_ids 0 --name MSMT17_ft_ResNet50 --train_all --batchsize 32 --PCB torchvision is 1.4.0 python version is 3.7

layumi commented 4 years ago

Hi @yian2271368 You may consider to tune down the learning rate.

yian2271368 commented 4 years ago

@layumi hey, i have tried differnet learning rates, i guess it's not the problem of learning rates. train loss did not change much since the first epoch

layumi commented 4 years ago

@yian2271368 Have you tried to use the same setting on Market?

yian2271368 commented 4 years ago

@layumi yes, the setting is the same, except the learning rate and image size.

yian2271368 commented 4 years ago

i solved the problem. the issued caused because i put Scheduler.step() after optimizer.step(). ps: that's what new version pytorch told me to do. but this might cause gradient did not update(i don't know how and why this happened yet). thus, i put scheduler.step back, and everything works.