Closed wangxiao5791509 closed 7 years ago
@wangxiao5791509 Seems to be a bug in pytorch v0.2. A quick workaround is to change this line to
dist_an.append(dist[i][mask[i] == 0].min())
Also refers to #18.
@Cysu Thanks for your replay. It worked. However, I found one bug of your paper, after that. When testing, it show me the error:
I solved this issue using unsqueeze provided by pytorch ...
maybe you should check this ...
@wangxiao5791509 Thank you very much for pointing out this issue! PyTorch changes the behavior quite a bit from v0.12 to v0.2. We will adapt our code base to v0.2 soon. Many thanks again.
@Cysu That's cool. Waiting for your update of this code. Here, I run the code and test it, the results is (triplet loss + resnet50 + market1501 + batchsize=64):
But the benchmark results is :
So, I wonder how can I achieve the performance as high as the benmark results ?? Waiting for your replay. Thank you very much .
@wangxiao5791509 There is a command at the end of each row of the benchmark table. If you only have one GPU, may consider reducing the batch size and learning rate accordingly, please refer to this section.
The original errors have been fixed in #20.
Hi, recently, the pytorch has updated and the code does not run smoothly in the new pytorch version. The following error occurs, could you please update a new version of the code ?
Traceback (most recent call last): File "examples/triplet_loss.py", line 217, in
main(parser.parse_args())
File "examples/triplet_loss.py", line 145, in main
trainer.train(epoch, train_loader, optimizer)
File "build/bdist.linux-x86_64/egg/reid/trainers.py", line 31, in train
File "build/bdist.linux-x86_64/egg/reid/trainers.py", line 80, in _forward
File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 224, in call
result = self.forward(*input, kwargs)
File "build/bdist.linux-x86_64/egg/reid/loss/triplet.py", line 26, in forward
File "/usr/local/lib/python2.7/dist-packages/torch/autograd/variable.py", line 826, in rsub
return SubConstant.apply(other, self)
File "/usr/local/lib/python2.7/dist-packages/torch/autograd/_functions/basicops.py", line 130, in forward
return tensor.neg().add(constant)
AttributeError: 'torch.cuda.ByteTensor' object has no attribute 'neg'**