Cysu / open-reid

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

open-reid用于其它数据集出现错误 #54

Closed XiaoDin9 closed 6 years ago

XiaoDin9 commented 6 years ago

使用open-reid 来训练 PRW 数据集遇到了问题,我的做法是把 PRW 数据制作成 Market-1501 的那种格式,包括bouding_box_test/train 甚至 PRW 的名字和里面各个文件名我都修改成跟 Market-1501 一样,我也修改过 reid/datasets/init.py 和 market1501.py 文件,运行始终出现如下的错误:Please download the dataset manually from https://drive.google.com/file/d/0B8-rUzbwVRk0c054eEozWG9COHM/view to /home/test/work_space/open-reid master/examples/data/market1501/raw/Market-1501-v15.09.15.zip,我发现导致这个问题的缘由在 market1501.py 文件中的这行代码出错: if osp.isfile(fpath) and hashlib.md5(open(fpath, 'rb').read()).hexdigest() == self.md5: 因为我制作的PRW数据在网络上根本找不到对应的数据下载的网址,我尝试修改成:hashlib.md5(open(fpath, 'rb').read()).hexdigest() != self.md5: (或者去掉这个代码),结果还是出现同样的错误,然后我调试程序,我发现程序真正执行的init.py 和 market1501.py 中的代码根本没有改变,我觉得好奇怪:不管我始终怎样修改market1501.py代码,每次修改我都做了保存,但是实际上程序依然执行的原来的init.py 和 market1501.py 代码,具体我也不清楚到底是哪里错了问题,希望能得到作者的帮助,谢谢啦!

zydou commented 6 years ago

Hi, @XiaoDin9 . It's probably because you follow the Installation section in README:

git clone https://github.com/Cysu/open-reid.git
cd open-reid
python setup.py install

After executing the first command git clone https://github.com/Cysu/open-reid.git, you will get a directory named open-reid. The last command python setup.py install will install open-reid as a package to your site-packages location. If you modify some code in the open-reid directory, it has no effect on open-reid in your site-packages location. More info: https://docs.python.org/3.6/install/index.html#how-installation-works

To solve the problem, I recommend you uninstall open-reid from your site-packages location and add a line sys.path.append('./') to open-reid/example/softmax_loss.py above from reid import datasets

MartinXM commented 6 years ago

Run python setup.py install after you modify the files.

Cysu commented 6 years ago

@zydou @MartinXM Many thanks to your detailed solutions!