Why accuracy is remaining 0?
See original GitHub issueHi, I follow your README to run the code, but the classification accuracy is remaining 0 after several epoch. Is there something important I neglected? Thank you very much!
[epoch 4: 160/307] train loss: 0.928064 lr: 0.00100
[epoch 4: 180/307] train loss: 0.486494 lr: 0.00100
[epoch 4: 200/307] train loss: 0.455191 lr: 0.00100
[epoch 4: 220/307] train loss: 0.509143 lr: 0.00100
[epoch 4: 240/307] train loss: 0.903722 lr: 0.00100
[epoch 4: 260/307] train loss: 0.333634 lr: 0.00100
[epoch 4: 280/307] train loss: 0.712478 lr: 0.00100
val loss: 0.488999 acc: 0.000000
[epoch 4: 300/307] train loss: 0.461941 lr: 0.00100
[epoch 5: 0/307] train loss: 0.480295 lr: 0.00100
[epoch 5: 20/307] train loss: 0.308337 lr: 0.00100
[epoch 5: 40/307] train loss: 0.756740 lr: 0.00100
[epoch 5: 60/307] train loss: 0.552190 lr: 0.00100
[epoch 5: 80/307] train loss: 0.518123 lr: 0.00100
[epoch 5: 100/307] train loss: 0.719212 lr: 0.00100
[epoch 5: 120/307] train loss: 0.408349 lr: 0.00100
[epoch 5: 140/307] train loss: 0.633257 lr: 0.00100
val loss: 0.446945 acc: 0.000000
[epoch 5: 160/307] train loss: 0.779942 lr: 0.00100
[epoch 5: 180/307] train loss: 0.585827 lr: 0.00100
[epoch 5: 200/307] train loss: 0.550597 lr: 0.00100
[epoch 5: 220/307] train loss: 0.406125 lr: 0.00100
[epoch 5: 240/307] train loss: 0.290858 lr: 0.00100
[epoch 5: 260/307] train loss: 0.365490 lr: 0.00100
[epoch 5: 280/307] train loss: 0.821365 lr: 0.00100
val loss: 0.458882 acc: 0.000000
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Why is the accuracy for my Keras model always 0 when ...
I updated my answer. However, that doesn't change the fact that as it currently written, the model corresponds to a regression problem.
Read more >machine learning - Why does accuracy remain the same
A "reasonable" scale is usually something in the range of a 0-mean, unit-variance normal distribution. Effect of fixing these issues. Let's look ...
Read more >My dogs vs cats models always have 0.5 accuracy
Again, same thing: accuracy 0.5. During training, accuracy always hovers around 0.5, and doesn't improve. Training more epochs doesn't help.
Read more >Training accuracy remains constant and loss keeps decreasing
There could be multiple reasons for this, including a high learning rate, outlier data being used while training etc. You can try reducing...
Read more >Train loss is decreasing, but accuracy remain the same
This means you are overfitting (training loss diminished but no improvement in validation loss/accuracy) so you should try using any technique ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
At line 159 in train_cls.py, change (preds ==labels).sum() to (preds ==labels).sum().item() as suggested by @ANGELALIGN-BOWEN
@jofury It works ! Thank you !