dapengchen123 / crf_affinity Goto Github PK
View Code? Open in Web Editor NEWDefine the feature distance
Define the feature distance
Is there no test part in the code? I only see the training part.And why did 'prec_score' always 0.00%
Hello,
Thank you!!
Environment: Pytorch 0.4.1 Python3.5 CUDA 8.0 GPU: Taitan xp
Problem: trainers.py print('gallery scores') print(gallery_scores4)
appear: gallery scores
tensor([nan,nan,.....nan],
..............................)
RuntimeError: cudaEventSynchronize in future:: wait: device-side assert triggered, Last program crash
Please help me, thanks.
Why I calculated dist_mat values near 0.25, whether or not the same person.But in the work, both local similarity and group similarity are assumed to be within the range(0, 1).The higher values the similarities are, the more likely the two images belong to a same person.
Hi, Thanks for releasing the code.
To whomever is using this software, may you share the hardware environment you have when you run the standard_batch.sh?
The code I run is
CUDA_VISIBLE_DEVICES=0,1,2,3 python3 crfjointlossfpn.py -b 66 --epoch 43 --instances_num 6 --cnnlr 1e-2 --logs-dir logs/evaluate_feature-66-6
I have 4 Titan Xp GPUs, each of which has 12GB. I am using pytorch 0.4.
However, I always have out of memory error when evaluating.
It throws the error when extracting features using the ResNetFPN backbone as shown in the following messages.
The weird thing is CUDA_VISIBLE_DEVICES=0,1 or 0,1,2,3 both gave me the same error at the same place.
BTW, in the crfjointlossfpn.py
file, from line 124-150, if I do not understand wrongly, the best model is selected based on test performance not the validation performance, which is a little bit disobeying what people normally do.
THCudaCheck FAIL file=/opt/conda/conda-bld/pytorch_1524584710464/work/aten/src/THC/generic/THCStorage.cu line=58 error=2 : out of memory
Traceback (most recent call last):
File "crfjointlossfpn.py", line 217, in
main(parser.parse_args())
File "crfjointlossfpn.py", line 125, in main
top1 = evaluator.evaluate(query_loader, gallery_loader, dataset.query, dataset.gallery)
File "/home/test/Development/PersonReID/crf_affinity/reid/evaluator/msevaluator.py", line 140, in evaluate
distmat = self.compute_distmat(queryloader, galleryloader)
File "/home/test/Development/PersonReID/crf_affinity/reid/evaluator/msevaluator.py", line 192, in compute_distmat
queryfeat1, queryfeat2, queryfeat3 = self.extractfeature(queryloader)
File "/home/test/Development/PersonReID/crf_affinity/reid/evaluator/msevaluator.py", line 114, in extractfeature
query_feat1, query_feat2, query_feat3 = self.cnnmodel(imgs)
File "/home/test/miniconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in call
result = self.forward(*input, **kwargs)
File "/home/test/miniconda3/lib/python3.6/site-packages/torch/nn/parallel/data_parallel.py", line 114, in forward
outputs = self.parallel_apply(replicas, inputs, kwargs)
File "/home/test/miniconda3/lib/python3.6/site-packages/torch/nn/parallel/data_parallel.py", line 124, in parallel_apply
return parallel_apply(replicas, inputs, kwargs, self.device_ids[:len(replicas)])
File "/home/test/miniconda3/lib/python3.6/site-packages/torch/nn/parallel/parallel_apply.py", line 65, in parallel_apply
raise output
File "/home/test/miniconda3/lib/python3.6/site-packages/torch/nn/parallel/parallel_apply.py", line 41, in _worker
output = module(*input, **kwargs)
File "/home/test/miniconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in call
result = self.forward(*input, **kwargs)
File "/home/test/Development/PersonReID/crf_affinity/reid/models/resfpnnet.py", line 117, in forward
x = module(x)
File "/home/test/miniconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in call
result = self.forward(*input, **kwargs)
File "/home/test/miniconda3/lib/python3.6/site-packages/torch/nn/modules/container.py", line 91, in forward
input = module(input)
File "/home/test/miniconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in call
result = self.forward(*input, **kwargs)
File "/home/test/miniconda3/lib/python3.6/site-packages/torchvision-0.2.1-py3.6.egg/torchvision/models/resnet.py", line 84, in forward
File "/home/test/miniconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in call
result = self.forward(*input, **kwargs)
File "/home/test/miniconda3/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 301, in forward
self.padding, self.dilation, self.groups)
RuntimeError: cuda runtime error (2) : out of memory at /opt/conda/conda-bld/pytorch_1524584710464/work/aten/src/THC/generic/THCStorage.cu:58
Hi, @dapengchen123 , We see that the reported accuracy is based on the model validated on the test set(query_loader,gallery_loader), which is very confusing. If i understand correctly, it seems like you violate the training protocol for person reid task where the norm is to utilize the validation set(disjoint from the test set) for the model selection. Can you please update the issue regarding this.
This will be much appreciated. Thank you so much.
Thanks for releasing your code and it runs smoothly!
There is some details in the implementation about the local similarities that I don't fully understand. As mentioned in your paper the local similarities are computed by the LS module (FC+BN ...) but I found in the code that local similarities between all pairs of gallery images are computed by naive Feature distance as:
https://github.com/dapengchen123/crf_affinity/blob/master/reid/train/trainers.py#L573-L588
And I don't get the meaning of 'gamma=3' term in the above code. Could you kindly give more explanations? Thx
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.