levyfan / reid-mgn Goto Github PK
View Code? Open in Web Editor NEWReproduction of paper: Learning Discriminative Features with Multiple Granularities for Person Re-Identification
License: MIT License
Reproduction of paper: Learning Discriminative Features with Multiple Granularities for Person Re-Identification
License: MIT License
python3.6 pytorch 1.1 ,when run mgn.py get error
非常感谢您的复现,让我重新认识了这篇论文。有一个问题,我在运行的过程中表示并没有mock这个文件,这个mock的文件出现在train_market1501.py文件的第6行。希望您有空的时候可以帮助我解答,我将不胜感激~~
Hi, I have been working on this for few weeks and unfortunately, I still can't reproduce the result with the setting presented in the paper. how about your latest progress?
I also met the issue:
RuntimeError: cuda runtime error (2) : out of memory at /pytorch/aten/src/THC/THCTensorRandom.cu:25
the details:
(pytorch-mgn) [xxx@localhost mgn]$ python mgn.py
cuda
Namespace(model='mgn', root='/home/xiaozhenzhen/data/reid-mgn/mgn/dataset/Market-1501-v15.09.15', workers=28.0)
THCudaCheck FAIL file=/pytorch/aten/src/THC/THCTensorRandom.cu line=25 error=2 : out of memory
Traceback (most recent call last):
File "mgn.py", line 314, in
run()
File "mgn.py", line 258, in run
mgn = MGN(num_classes=len(train_dataset.unique_ids)).to(DEVICE)
File "/home/xiaozhenzhen/anaconda2/envs/pytorch-mgn/lib/python3.6/site-packages/torch/nn/modules/module.py", line 393, in to
return self._apply(lambda t: t.to(device))
File "/home/xiaozhenzhen/anaconda2/envs/pytorch-mgn/lib/python3.6/site-packages/torch/nn/modules/module.py", line 176, in _apply
module._apply(fn)
File "/home/xiaozhenzhen/anaconda2/envs/pytorch-mgn/lib/python3.6/site-packages/torch/nn/modules/module.py", line 176, in _apply
module._apply(fn)
File "/home/xiaozhenzhen/anaconda2/envs/pytorch-mgn/lib/python3.6/site-packages/torch/nn/modules/module.py", line 182, in _apply
param.data = fn(param.data)
File "/home/xiaozhenzhen/anaconda2/envs/pytorch-mgn/lib/python3.6/site-packages/torch/nn/modules/module.py", line 393, in
return self._apply(lambda t: t.to(device))
File "/home/xiaozhenzhen/anaconda2/envs/pytorch-mgn/lib/python3.6/site-packages/torch/cuda/init.py", line 161, in _lazy_init
torch._C._cuda_init()
RuntimeError: cuda runtime error (2) : out of memory at /pytorch/aten/src/THC/THCTensorRandom.cu:25
i also try this, the result is very bad.
do you try table 5 in paper? I try, but the result of table 5 the first line only 68, far away to 87.5....
how can I solve the problem?????
(pytorch-mgn) [xxx@localhost reid-mgn]$ python mgn/mgn.py
cuda
Namespace(model='mgn', root='/home/xiaozhenzhen/data/reid-mgn/mgn/../Market-1501-v15.09.15', workers=28.0)
Traceback (most recent call last):
File "mgn/mgn.py", line 313, in
run()
File "mgn/mgn.py", line 257, in run
mgn = MGN(num_classes=len(train_dataset.unique_ids)).to(DEVICE)
File "mgn/mgn.py", line 115, in init
self.fc_id_2048_0 = nn.Linear(2048, num_classes)
File "/home/xiaozhenzhen/anaconda2/envs/pytorch-mgn/lib/python3.6/site-packages/torch/nn/modules/linear.py", line 46, in init
self.reset_parameters()
File "/home/xiaozhenzhen/anaconda2/envs/pytorch-mgn/lib/python3.6/site-packages/torch/nn/modules/linear.py", line 49, in reset_parameters
stdv = 1. / math.sqrt(self.weight.size(1))
RuntimeError: dimension out of range (expected to be in range of [-1, 0], but got 1)
Each batch should include P id, and K image per id.
When I carried out the project I got this promblem:
Traceback (most recent call last):
File "/home/bruce/mgn/mgn/mgn.py", line 300, in
run()
File "/home/bruce/mgn/mgn/mgn.py", line 243, in run
mgn = MGN(num_classes=len(train_dataset.unique_ids)).to(DEVICE)
File "/home/bruce/.conda/envs/snowflake/lib/python3.6/site-packages/torch/nn/modules/module.py", line 393, in to
return self._apply(lambda t: t.to(device))
File "/home/bruce/.conda/envs/snowflake/lib/python3.6/site-packages/torch/nn/modules/module.py", line 176, in _apply
module._apply(fn)
File "/home/bruce/.conda/envs/snowflake/lib/python3.6/site-packages/torch/nn/modules/module.py", line 176, in _apply
module._apply(fn)
File "/home/bruce/.conda/envs/snowflake/lib/python3.6/site-packages/torch/nn/modules/module.py", line 182, in _apply
param.data = fn(param.data)
File "/home/bruce/.conda/envs/snowflake/lib/python3.6/site-packages/torch/nn/modules/module.py", line 393, in
return self._apply(lambda t: t.to(device))
TypeError: to() received an invalid combination of arguments - got (device), but expected one of:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.