Comments (8)
Hi @Sumes! I can not provide any help with this limited information. Did you use the newest version of this rep? What's your pytorch version? What's the output of your training process, in which I output the prediction accuracy on test dataset after every 100 mini-batchs. You still train your model with batch_size = 1? Anyway, that will be very helpful for our discussion if you can provide your code and output in a jupyter/ipython file.
from siamese-pytorch.
from siamese-pytorch.
I did not modify your code. can you please check the output with test batch size equal to one for two entire two image sets (in parallel)?
I think the problem is the with
pred = np.argmax(output)
pred value is zero even if the images are different.
from siamese-pytorch.
Please refer to this function:
Line 96 in c2b1567
There is trick to sample test data. I record the target image in self.img1 and always put the image whose class is same as self.img1 into the first position of each mini-batch. So if the model makes a right prediction, the 'pred = np.argmax(output)' should be 0. Hope that will be helpful. @Sumes
from siamese-pytorch.
from siamese-pytorch.
from siamese-pytorch.
loss_val += loss.data[0]
[10] loss: 0.69245 Took 7.14 s
[20] loss: 0.68544 Took 1.00 s
[30] loss: 0.66013 Took 0.99 s
[40] loss: 0.65271 Took 0.99 s
[50] loss: 0.63055 Took 1.00 s
[60] loss: 0.62372 Took 1.00 s
[70] loss: 0.61123 Took 1.00 s
[80] loss: 0.61168 Took 1.00 s
[90] loss: 0.60554 Took 0.99 s
[100] loss: 0.59638 Took 0.99 s
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
from siamese-pytorch.
When I am trying to print the value predicted (pred = np.argmax(output)),
with way = , then all the values predicted is 0.
So is this correct. please verify and tell. Pasting what i got below.
[10] loss: 0.69245 Took 7.14 s
[20] loss: 0.68544 Took 1.00 s
[30] loss: 0.66013 Took 0.99 s
[40] loss: 0.65271 Took 0.99 s
[50] loss: 0.63055 Took 1.00 s
[60] loss: 0.62372 Took 1.00 s
[70] loss: 0.61123 Took 1.00 s
[80] loss: 0.61168 Took 1.00 s
[90] loss: 0.60554 Took 0.99 s
[100] loss: 0.59638 Took 0.99 s
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
Pred-argmax: 0
[100] right: 100 error: 0 precision: 1.000000
from siamese-pytorch.
Related Issues (15)
- what are the arguments to be given along with 'python3 make_dataset.py'
- 92.5% precision HOT 1
- about dataloader's len HOT 3
- can I use torch1.6? HOT 2
- makedataset HOT 1
- Final accuracy HOT 1
- Shared memory error HOT 1
- dataset
- python3 train.py gives the following error: line 23, in find_classes FileNotFoundError: [Errno 2] No such file or directory: 'background' HOT 1
- Testing returns all cases matching with batch size one HOT 2
- Not able to reach more than 20% precision HOT 1
- Siamese network for binary classification
- Pretrained model HOT 1
- Is there any inference only script? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from siamese-pytorch.