andreasveit / triplet-network-pytorch

373 stars 96 forks source link

Accuracy is always zero #6

Closed sandeeprepakula closed 6 years ago

sandeeprepakula commented 6 years ago
screen shot 2018-06-21 at 1 55 46 pm

Anything I am missing. I just did a clone and ran train.py blindly without any changes. Accuracy is zero unlike the one shown in README

sandeeprepakula commented 6 years ago

I figured out the issue and fixed by changing below lines in train.py

Line number 254 from return (pred > 0).sum()*1.0/dista.size()[0] to (1.0* int((pred > 0).sum()[0]))/ (1.0* dista.size()[0])

I think this is because of python version I am using is 3.6 instead of 2.7. Not sure though.