Cysu / open-reid

Open source person re-identification library in python
https://cysu.github.io/open-reid/
MIT License
1.34k stars 349 forks source link

How can I train with a new dataset? And is it possible to finish by cpu only #49

Closed hustmf closed 6 years ago

hustmf commented 6 years ago

Hi, I'm trying to do a reid project with a new dataset. But the size of the images are different from each other. So what should I do to train with such dataset? Just convert it to the unified format? What should I do to split them into "trainval,gallery,query"? I only have one dataset with person id label. and camera id wasn't provided. And when I run the example in readme on a server with gpu, error happened. TypeError: sum received an invalid combination of arguments -got(dim=int, keepdim=bool) but expected one of no arguments *(int dim) It happened at reid/evaluation_metrics/classification.py line 17. I haven't solved it. But I have tried cpu version on my laptop by modifying some part of the code(delete cuda() and let pin_memory=False), then I got train data of epoch[0] like CMC score. Although I stopped training due to the bad performance of laptop, could the data printed verify that I can run with cpu? Will the change that I made in the code have influence on the training result? After training epoch[0],I got Mean AP:4.5% CMC Scores allshots cuhk03 market1501 top-1 0.5% 3.5% 0.5% top-5 5.0% 10.0% 5.0% top-10 10.5% 21.0% 10.5% It's quite low. My pc can't support continuing training. Will the result be better by training rest data? Or the bad result is due to my change to the code? Could someone tell me? Another problem is that how can I get the probability ranking of each image in the gallery if I use certain image as query?

hustmf commented 6 years ago
Traceback (most recent call last):
  File "examples/softmax_loss.py", line 217, in <module>
    main(parser.parse_args())
  File "examples/softmax_loss.py", line 147, in main
    trainer.train(epoch, train_loader, optimizer)
  File "/workspace/gjc/anaconda2/envs/py35/lib/python3.5/site-packages/open_reid-0.2.0-py3.5.egg/reid/trainers.py", line 31, in train
  File "/workspace/gjc/anaconda2/envs/py35/lib/python3.5/site-packages/open_reid-0.2.0-py3.5.egg/reid/trainers.py", line 73, in _forward
  File "/workspace/gjc/anaconda2/envs/py35/lib/python3.5/site-packages/open_reid-0.2.0-py3.5.egg/reid/evaluation_metrics/classification.py", line 17, in accuracy
TypeError: sum received an invalid combination of arguments - got (keepdim=bool, dim=int, ), but expected one of:
 * no arguments
 * (int dim)

When I ran example in readme on server, error above happened. @Cysu @zydou

Linranran commented 6 years ago

update your pytorch version

hustmf commented 6 years ago

@Linranran Thank you!

Cysu commented 6 years ago

@Linranran Many thanks!