Coder Social home page Coder Social logo

pcb_rpp_for_reid's People

Contributors

syfafterzy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pcb_rpp_for_reid's Issues

Error occur trainers_partloss.py

In file reid/trainers_partloss.py, line 41, in train
torch.autograd.backward([ loss0, loss1, loss2, loss3, loss4, loss5],[torch.ones(1).cuda(), torch.ones(1).cuda(), torch.ones(1).cuda(),torch.ones(1).cuda(),torch.ones(1).cuda(),torch.ones(1).cuda(),torch.ones(1).cuda()])
RuntimeError: Mismatch in shape: grad_output[0] has a shape of torch.Size([1]) and output[0] has a shape of torch.Size([]).

I don't know what's going wrong with this, can some one help me?

Error occur when run train_PCB.sh

In file reid/models/resnet.py, line131, in foward
x = F.avg_pool2d(x,kernel_size=(kx,x.size(3)),stride=(sx,x.size(3))) # H4 W8
TypeError: avg_pool2d() argument 'stride' must be tuple of ints, but found element of type float at pos1

I don't know what's going wrong with this, can some one help me?

PRR stage seems the same as PCB stage?

what's the difference between the PRR.py and PCB.py file ? I noted that, in PRR.py, you create model with additional parameters (T,dim), but in the resnet.py file, these two parameters seems not used ?

Error occured when run train_RPP.sh

Traceback (most recent call last):
File "RPP.py", line 226, in
main(parser.parse_args())
File "RPP.py", line 166, in main
checkpoint = load_checkpoint(osp.join(args.logs_dir, 'checkpoint.pth.tar'))
File "/home/uers/PCB_RPP_for_reID-master/reid/utils/serialization.py", line 37, in load_checkpoint
raise ValueError("=> No checkpoint found at '{}'".format(fpath))
ValueError: => No checkpoint found at 'logs/market-1501/RPP/checkpoint.pth.tar'

你好,借用了您的代码

复现时,出现了,market和duck数据库加载不了的情况。
python PCB.py
--dataset duke
--data-dir /home/zhangdelei/PCB_RPP_for_reID-master/
--height 256
--width 128
--resume /home/zhangdelei/PCB_RPP_for_reID-master/
这是我的训练参数,请问是否是我参数有问题,或者是路径问题

duke数据集使用train_rpp.py

image
作者您好,我用duke数据集训练的时候,出现了这个错误,但是我train_pcb.py的时候本来就是用的duke数据集,但是不知道为何当前模型会出现market1501的751个行人。该改的路径我也改了。不知道出错在哪里

CUDA error: out of memory

When I use 6G GPU to run "sh train_PCB.sh" code and get the following error:
(some one suggested that this may caused by batch_size set too big, is this the case and how to resolve this?) Thanks.

$ sh train_PCB.sh
Market dataset loaded
subset | # ids | # images

train | 751 | 12936
query | 750 | 3368
gallery | 751 | 15913
/home/peter/下载/re-ID/PCB_RPP_for_reID/reid/models/resnet.py:47: UserWarning: nn.init.kaiming_normal is now deprecated in favor of nn.init.kaiming_normal_.
init.kaiming_normal(self.local_conv.weight, mode= 'fan_out')
/home/peter/下载/re-ID/PCB_RPP_for_reID/reid/models/resnet.py:50: UserWarning: nn.init.constant is now deprecated in favor of nn.init.constant_.
init.constant(self.feat_bn2d.weight,1) #initialize BN, may not be used
/home/peter/下载/re-ID/PCB_RPP_for_reID/reid/models/resnet.py:51: UserWarning: nn.init.constant is now deprecated in favor of nn.init.constant_.
init.constant(self.feat_bn2d.bias,0) # iniitialize BN, may not be used
/home/peter/下载/re-ID/PCB_RPP_for_reID/reid/models/resnet.py:55: UserWarning: nn.init.normal is now deprecated in favor of nn.init.normal_.
init.normal(self.instance0.weight, std=0.001)
/home/peter/下载/re-ID/PCB_RPP_for_reID/reid/models/resnet.py:56: UserWarning: nn.init.constant is now deprecated in favor of nn.init.constant_.
init.constant(self.instance0.bias, 0)
/home/peter/下载/re-ID/PCB_RPP_for_reID/reid/models/resnet.py:60: UserWarning: nn.init.normal is now deprecated in favor of nn.init.normal_.
init.normal(self.instance1.weight, std=0.001)
/home/peter/下载/re-ID/PCB_RPP_for_reID/reid/models/resnet.py:61: UserWarning: nn.init.constant is now deprecated in favor of nn.init.constant_.
init.constant(self.instance1.bias, 0)
/home/peter/下载/re-ID/PCB_RPP_for_reID/reid/models/resnet.py:65: UserWarning: nn.init.normal is now deprecated in favor of nn.init.normal_.
init.normal(self.instance2.weight, std=0.001)
/home/peter/下载/re-ID/PCB_RPP_for_reID/reid/models/resnet.py:66: UserWarning: nn.init.constant is now deprecated in favor of nn.init.constant_.
init.constant(self.instance2.bias, 0)
/home/peter/下载/re-ID/PCB_RPP_for_reID/reid/models/resnet.py:70: UserWarning: nn.init.normal is now deprecated in favor of nn.init.normal_.
init.normal(self.instance3.weight, std=0.001)
/home/peter/下载/re-ID/PCB_RPP_for_reID/reid/models/resnet.py:71: UserWarning: nn.init.constant is now deprecated in favor of nn.init.constant_.
init.constant(self.instance3.bias, 0)
/home/peter/下载/re-ID/PCB_RPP_for_reID/reid/models/resnet.py:75: UserWarning: nn.init.normal is now deprecated in favor of nn.init.normal_.
init.normal(self.instance4.weight, std=0.001)
/home/peter/下载/re-ID/PCB_RPP_for_reID/reid/models/resnet.py:76: UserWarning: nn.init.constant is now deprecated in favor of nn.init.constant_.
init.constant(self.instance4.bias, 0)
/home/peter/下载/re-ID/PCB_RPP_for_reID/reid/models/resnet.py:80: UserWarning: nn.init.normal is now deprecated in favor of nn.init.normal_.
init.normal(self.instance5.weight, std=0.001)
/home/peter/下载/re-ID/PCB_RPP_for_reID/reid/models/resnet.py:81: UserWarning: nn.init.constant is now deprecated in favor of nn.init.constant_.
init.constant(self.instance5.bias, 0)
Traceback (most recent call last):
File "PCB.py", line 202, in
main(parser.parse_args())
File "PCB.py", line 145, in main
trainer.train(epoch, train_loader, optimizer)
File "/home/peter/下载/re-ID/PCB_RPP_for_reID/reid/trainers_partloss.py", line 33, in train
loss0, loss1, loss2, loss3, loss4, loss5, prec1 = self._forward(inputs, targets)
File "/home/peter/下载/re-ID/PCB_RPP_for_reID/reid/trainers_partloss.py", line 74, in _forward
outputs = self.model(*inputs)
File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/torch/nn/parallel/data_parallel.py", line 121, in forward
return self.module(*inputs[0], **kwargs[0])
File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/home/peter/下载/re-ID/PCB_RPP_for_reID/reid/models/resnet.py", line 121, in forward
x = module(x)
File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/container.py", line 91, in forward
input = module(input)
File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/torchvision/models/resnet.py", line 91, in forward
identity = self.downsample(x)
File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/container.py", line 91, in forward
input = module(input)
File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/module.py", line 477, in call
result = self.forward(*input, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/torch/nn/modules/batchnorm.py", line 66, in forward
exponential_average_factor, self.eps)
File "/usr/local/lib/python2.7/dist-packages/torch/nn/functional.py", line 1254, in batch_norm
training, momentum, eps, torch.backends.cudnn.enabled
RuntimeError: CUDA error: out of memory

train the model

Hi,I am very glad that you open your source code, but when I try to train, I have encountered this problem, how can I solve it?
1

RPP性能只有43.9

你好,感谢你将代码分享出来。
我在跑你的实验时发现,光是训PCB,按照你的配置是可以得到给出来的性能的,但是训练RPP的时候在market1501上只有43.9的mAP,我想确定下是第一步只训练PCB20个epoch,并且学习率不下降?(因为下降次数为20epoch);第二步训练RPP50个epoch,然后20次的时候下降一次学习率。这种默认的配置是正确的么

Why some operations are not same in two model files?

In ./reid/models/resnet.py Line164:

  1. Why calulating the mean and norm the out2?
center = out1.mean(0).unsqueeze(0).expand_as(out1)
out2 = x/x.norm(2,1).unsqueeze(1).expand_as(x)

out2 is calculated without self.feat and self.feat_bn and the value of center is not used?

  1. But in the resnet_rpp.py:
    the out2 is :
        if self.has_embedding:
            x = self.feat(x)
            x = self.feat_bn(x)
            out2 = x/ x.norm(2,1).unsqueeze(1).expand_as(x)

The operations are not same, is there some reason for such implementation?
Is this because it is not used in the model due to the self.FCN=True? So that we can ignore the following operations ?

  1. the model add a lot of norm operations, it seems like that when we need an output from the model, we add a norm operation, such as resnet_rpp.py Line 153,159,162, is there any reason?

A little suggestion:

>>> import torch
>>> import torch.nn.functional as F
>>> aaa=torch.rand(32,1024,8,4)
>>> feat_F_norm = F.normalize(aaa)
>>> feat_ = aaa/aaa.norm(2,1).unsqueeze(1).expand_as(aaa)
>>> torch.sum(feat_F_norm-feat_)
tensor(0.)

you can use F.normalize instead of the operations in the paper, they are same.

when extracting image features

When I run RPP.py for evaluation, I find that it walk through dropout to get out0(images features through RPP model) for calculating pairwise distance, I wonder if it will influence the correct of images features for testing.
Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.