open-reid
open-reid copied to clipboard
some questions come out when I want to modify some files
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()
You should re-install the library through python setup.py install
to let the changes take effect.