KovenYu / MAR

Pytorch code for our CVPR'19 (oral) work: Unsupervised person re-identification by soft multilabel learning
https://kovenyu.com/publication/2019-cvpr-mar/
315 stars 83 forks source link

construct_dataset gives empty dataset matrix #11

Closed BuaaAlen closed 5 years ago

BuaaAlen commented 5 years ago

The error I met is(in the epoch 0): features = torch.cat(features, dim=0) RuntimeError: expected a non-empty list of Tensors

BuaaAlen commented 5 years ago

After I ran the 'construct_dataset_Market.m' using MATLAB, I found that the 'Market.mat' 's size is only 300M. However, the file you shared in the BaiduYun Link is 2G+. What's wrong with me? Thx Maybe the torch.cat question above is due to this.

KovenYu commented 5 years ago

Hi @BuaaAlen ,

  1. what is the full error message (including line number)?
  2. is the matrix size correct? (should be something looks like [384,128,3,12000] for training data of Market-1501)
BuaaAlen commented 5 years ago

No. The 'train_data' matrix in Market.mat generated by me is None. I have no idea and I ordered the 'readme.md' strictly during the generating process. Thx.

KovenYu commented 5 years ago

@BuaaAlen Then I think the problem is in your formatting of the image data in the training set (and probably the testing set as well). I assumed the file names of the images were kept unchanged as they were downloaded: something looks like 0000_c1s1_000111_01.jpg, so that a filter would apply to filter out the special filenames (i.e. the "." and ".." in Linux file system).

Given that your matrix is empty, probably the filter has let out all the entries for the training set.

Therefore,

  1. please check whether your image folder path is correctly specified.
  2. please check whether, in the specified path, the training images are correctly named as downloaded (something looks like 0000_c1s1_000111_01.jpg). Please also check this for testing images and query images.
  3. are you using windows? I'm not sure about the behavior of the "dir" function in windows environments and it might (not likely, though) be problematic.
BuaaAlen commented 5 years ago

Firstly I am very grateful for your comprehensive answer! I uploaded the necessary files to a BaiduYun Link, containing 1 a folder named"Market-1501-v15.09.15" 2 "construct_dataset_Market.m" 3 "uniquize.m"

https://pan.baidu.com/s/1nrSKd87CAwVmZomAUYo8ng password:dwi0

If you run the "construct_dataset_Market.m" code using MATLAb, you will get a wrong "Market.mat" whose size is 300M, not 2.7G+. I will appreciate it if you can run the codes to reproduce the problem I met.

BuaaAlen commented 5 years ago

I just found the mistake I made from a closed issue......Thanks again!

KovenYu commented 5 years ago

@BuaaAlen great to see your problem addressed. would you mind giving a link to the closed issue to provide references to other guys who might encounter similar problems?

BuaaAlen commented 5 years ago

The issue's link is https://github.com/KovenYu/MAR/issues/4