Open Akhiladdh opened 5 years ago
Initialize the running_corrects to 0.0 instead of 0 in the function train_model in file tars/tars_training.py
Initialize the running_corrects to 0.0 instead of 0 in the function train_model in file tars/tars_training.py
I have tried your method, but it didn't work, either
Initialize the running_corrects to 0.0 instead of 0 in the function train_model in file tars/tars_training.py
I have tried your method, but it didn't work, either
I have found the solution
running_corrects += torch.sum(preds == labels.data)
change to
running_corrects += float(torch.sum(preds == labels.data))
as well
Even after training for many epoch accuracy is remaining 0.
Epoch 50/199
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3378/3378 [20:02<00:00, 2.81it/s] train Loss: 0.0236 Acc: 0.0000 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 230/230 [00:40<00:00, 5.74it/s] val Loss: 0.0234 Acc: 0.0000