pytorch-beginner icon indicating copy to clipboard operation
pytorch-beginner copied to clipboard

acc 计算错误

Open wenfengzCN opened this issue 6 years ago • 0 comments

文件:05-Recurrent Neural Network/recurrent_network.py 例如:line 86 if i % 300 == 0: print('[{}/{}] Loss: {:.6f}, Acc: {:.6f}'.format( epoch + 1, num_epoches, running_loss / (batch_size * i), running_acc / (batch_size * i))) 错误值:running_loss / (batch_size*i) 等于零 原因: running_loss 为int类型 解决方法: running_loss.double()

wenfengzCN avatar Sep 12 '18 09:09 wenfengzCN