huanghoujing / beyond-part-models

PCB of paper: Beyond Part Models: Person Retrieval with Refined Part Pooling, using Pytorch
331 stars 81 forks source link

Issue of model #2

Closed daodaofr closed 6 years ago

daodaofr commented 6 years ago

When I train a model on Market 1501, the training process seems fine. In the training log, I got mAP 70%, cmc1 89% on test dataset.

But when I run your test script and load the my trained model for test, I only get mAP 3%, cmc1 11%.

If I load your model, I can get your results.

Do you have any idea what cause this gap? On issue I notice is that my ckpt.pth model is ~200M, which is twice the size of your model (100M).

huanghoujing commented 6 years ago

Thanks for your attention.

In my script, model_weight_file and ckpt_file are two different things. The former only contains the state_dict of the model; the latter also contains optimizer states. My uploaded model_weight_file is just taken out of my trained ckpt_file, thus the file size is about one half.

So if you want to test your own trained ckpt_file, you can use this command:

python script/experiment/train_pcb.py \
-d '(0,)' \
--only_test true \
--dataset DATASET_NAME \
--trainset_part TRAINVAL_OR_TRAIN \
--exp_dir EXPERIMENT_DIRECTORY \
--steps_per_log 20 \
--epochs_per_val 1

That is the same command as your training command, except that only_test is set to true, meaning only testing the model without training.

If your problem is not solved, can you provide the full log file that shows the result of mAP 3%, cmc1 11%? So that I can check if it is the problem I mentioned above.

daodaofr commented 6 years ago

Thank you for your reply, which perfectly solves my issue.