Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

train.py训练时,loss出现Nan值 #1

Open
SEUZTh opened this issue Dec 1, 2021 · 0 comments
Open

train.py训练时,loss出现Nan值 #1

SEUZTh opened this issue Dec 1, 2021 · 0 comments

Comments

@SEUZTh
Copy link

SEUZTh commented Dec 1, 2021

/opt/anaconda3/envs/pytorch/bin/python /Users/zth/PycharmProjects/pytorchFastTutorial/train.py
Files already downloaded and verified
Files already downloaded and verified
训练数据集的长度为:50000
测试数据集的长度为:10000
-------第 1 轮训练开始------
/opt/anaconda3/envs/pytorch/lib/python3.8/site-packages/torch/nn/functional.py:718: UserWarning: Named tensors and all their associated APIs are an experimental feature and subject to change. Please do not use them for anything important until they are released as stable. (Triggered internally at  /Users/distiller/project/conda/conda-bld/pytorch_1623459044803/work/c10/core/TensorImpl.h:1156.)
  return torch.max_pool2d(input, kernel_size, stride, padding, dilation, ceil_mode)
训练次数:100, Loss:1.9817659854888916
训练次数:200, Loss:1.9057204723358154
训练次数:300, Loss:1.7302981615066528
训练次数:400, Loss:1.5506035089492798
训练次数:500, Loss:1.6042922735214233
训练次数:600, Loss:2.496931314468384
训练次数:700, Loss:1.6171432733535767
整体测试集上的Loss: 262.62046909332275
整体测试集上的正确率: 0.3889999985694885
模型已保存
-------第 2 轮训练开始------
训练次数:800, Loss:1.2562278509140015
训练次数:900, Loss:1.1422173976898193
训练次数:1000, Loss:1.416947603225708
训练次数:1100, Loss:1.4992238283157349
训练次数:1200, Loss:1.331336259841919
训练次数:1300, Loss:1.245829463005066
训练次数:1400, Loss:1.0655444860458374
训练次数:1500, Loss:1.2835123538970947
整体测试集上的Loss: 230.35630249977112
整体测试集上的正确率: 0.4925000071525574
模型已保存
-------第 3 轮训练开始------
训练次数:1600, Loss:1.0310918092727661
训练次数:1700, Loss:1.0611821413040161
训练次数:1800, Loss:1.0310254096984863
训练次数:1900, Loss:1.144779086112976
训练次数:2000, Loss:1.2882472276687622
训练次数:2100, Loss:0.9842464327812195
训练次数:2200, Loss:0.7923548221588135
训练次数:2300, Loss:1.1152539253234863
整体测试集上的Loss: 256.62166798114777
整体测试集上的正确率: 0.4763999879360199
模型已保存
-------第 4 轮训练开始------
训练次数:2400, Loss:1.2120356559753418
训练次数:2500, Loss:0.9000757336616516
训练次数:2600, Loss:1.05060613155365
训练次数:2700, Loss:1.0712412595748901
训练次数:2800, Loss:1.121010184288025
训练次数:2900, Loss:nan
训练次数:3000, Loss:nan
训练次数:3100, Loss:nan
整体测试集上的Loss: nan
整体测试集上的正确率: 0.10000000149011612
模型已保存
-------第 5 轮训练开始------
训练次数:3200, Loss:nan
训练次数:3300, Loss:nan
训练次数:3400, Loss:nan
训练次数:3500, Loss:nan
训练次数:3600, Loss:nan
训练次数:3700, Loss:nan
训练次数:3800, Loss:nan
训练次数:3900, Loss:nan
整体测试集上的Loss: nan
整体测试集上的正确率: 0.10000000149011612
模型已保存
-------第 6 轮训练开始------
训练次数:4000, Loss:nan
训练次数:4100, Loss:nan
训练次数:4200, Loss:nan
训练次数:4300, Loss:nan
训练次数:4400, Loss:nan
训练次数:4500, Loss:nan
训练次数:4600, Loss:nan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant