我正在训练一个网络,并且将学习率从0.1更改为0.00001。输出始终保持不变。绝不用于培训。
如此奇怪的损失可能是什么原因?
I1107 15:07:28.381621 12333 solver.cpp:404] Test net output #0: loss = 3.37134e+11 (* 1 = 3.37134e+11 loss)
I1107 15:07:28.549142 12333 solver.cpp:228] Iteration 0, loss = 1.28092e+11
I1107 15:07:28.549201 12333 solver.cpp:244] Train net output #0: loss = 1.28092e+11 (* 1 = 1.28092e+11 loss)
I1107 15:07:28.549211 12333 sgd_solver.cpp:106] Iteration 0, lr = 1e-07
I1107 15:07:59.490077 12333 solver.cpp:228] Iteration 50, loss = -nan
I1107 15:07:59.490170 12333 solver.cpp:244] Train net output #0: loss = 0 (* 1 = 0 loss)
I1107 15:07:59.490176 12333 sgd_solver.cpp:106] Iteration 50, lr = 1e-07
I1107 15:08:29.177093 12333 solver.cpp:228] Iteration 100, loss = -nan
I1107 15:08:29.177119 12333 solver.cpp:244] Train net output #0: loss = 0 (* 1 = 0 loss)
I1107 15:08:29.177125 12333 sgd_solver.cpp:106] Iteration 100, lr = 1e-07
I1107 15:08:59.758381 12333 solver.cpp:228] Iteration 150, loss = -nan
I1107 15:08:59.758513 12333 solver.cpp:244] Train net output #0: loss = 0 (* 1 = 0 loss)
I1107 15:08:59.758545 12333 sgd_solver.cpp:106] Iteration 150, lr = 1e-07
I1107 15:09:30.210208 12333 solver.cpp:228] Iteration 200, loss = -nan
I1107 15:09:30.210304 12333 solver.cpp:244] Train net output #0: loss = 0 (* 1 = 0 loss)
I1107 15:09:30.210310 12333 sgd_solver.cpp:106] Iteration 200, lr = 1e-07
最佳答案
您的损失不是0
,甚至没有接近。您从3.3e+11
开始(即〜10 ^ 11),似乎爆炸后不久就会得到nan
。您需要大幅度降低损失值。如果您使用的是"EuclideanLoss"
,则可能需要按深度图的大小对损失进行平均,将预测值缩放到[-1,1]
范围,或使用其他任何防止损失爆炸的缩放方法。
关于machine-learning - 咖啡损失为nan或0,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/40468983/