Cysu / open-reid

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

some questions come out when I want to modify some files #68

Open JackeyWang777 opened 6 years ago

JackeyWang777 commented 6 years ago

I want to modify the file'/examples/triplet loss' and add some parameters into the trainer. I have modified the file 'reid/trainers'

criterion1 = nn.CrossEntropyLoss().cuda()
criterion2 = TripletLoss(margin=args.margin).cuda()
trainer = Trainer(model,criterion1,criterion2,factor1,factor2)

class BaseTrainer(object):

def __init__(self, model,criterion,criterion2,factor1,factor2):
        super(BaseTrainer, self).__init__()
        self.model = model
        self.criterion = criterion#Triplet loss
        self.criterion2 = criterion2#softmax loss
        self.factor1 = factor1
        self.factor2 = factor2

But expection error come out: TypeError: init() takes exactly 3 arguments (6 given) Exception AttributeError: "'NoneType' object has no attribute 'path'" in <function _remove at 0x7ff757f877d0> ignored

Then I find that the file of path below is not modified ,when i run my file.The 'trainers.py' of that path has no changed. open-reid/build/bdist.linux-x86_64/egg/reid/trainers.py(14)init()

leobxpan commented 6 years ago

You should re-install the library through python setup.py install to let the changes take effect.