matlab做fast rcnn目标检测,训练Faster R-CNN的目标检测器时初始学习率过大

在使用'maxEpochs'为5,'miniBatchSize'为1,'initialLearnRate'设为1e-20进行训练时,尽管设置了极小的学习率,但训练过程中每个步骤的损失均为NaN,导致训练警告提示初始学习率可能过大。这可能由于学习率过小导致优化问题,或者数据预处理、模型结构、损失函数等方面存在错误。建议检查数据质量,尝试调整学习率、优化器或增加批次大小。
摘要由CSDN通过智能技术生成

训练网络时的设置如下

options = trainingOptions('sgdm', ...

'MaxEpochs', 5, ...

'MiniBatchSize', 1, ...

'InitialLearnRate', 1e-20,

'CheckpointPath', tempdir);

初始学习率'InitialLearnRate'已经设置到小数点后20位了。。。为什么训练完还是显示初始学习率可能过大?The training loss has NaN values的原因还与什么options有关?麻烦解答!谢谢!

%%%%%%%这是训练的step信息和报警信息%%%%%%%%%%%%%%%%%%%

Step 1 of 4: Training a Region Proposal Network (RPN).

Training on single CPU.

|=======================================================================================================|

|  Epoch  |  Iteration  |  Time Elapsed  |  Mini-batch  |  Mini-batch  |  Mini-batch  |  Base Learning  |

|         |             |   (hh:mm:ss)   |     Loss     |   Accuracy   |     RMSE     |      Rate       |

|=======================================================================================================|

|       1 |           1 |       00:00:03 |          NaN |        0.00% |          NaN |      1.0000e-20 |

|       5 |           5 |       00:01:44 |          NaN |        0.00% |          NaN |      1.0000e-20 |

|=======================================================================================================|

Step 2 of 4: Training a Fast R-CNN Network using the RPN from step 1.

--> Extracting region proposals from 16 training images...done.

Training on single CPU.

|=======================================================================================================|

|  Epoch  |  Iteration  |  Time Elapsed  |  Mini-batch  |  Mini-batch  |  Mini-batch  |  Base Learning  |

|         |             |   (hh:mm:ss)   |     Loss     |   Accuracy   |     RMSE     |      Rate       |

|=======================================================================================================|

|       1 |           1 |       00:00:03 |          NaN |      100.00% |          NaN |      1.0000e-20 |

|       5 |           5 |       00:01:46 |          NaN |      100.00% |          NaN |      1.0000e-20 |

|=======================================================================================================|

Step 3 of 4: Re-training RPN using weight sharing with Fast R-CNN.

Training on single CPU.

|=======================================================================================================|

|  Epoch  |  Iteration  |  Time Elapsed  |  Mini-batch  |  Mini-batch  |  Mini-batch  |  Base Learning  |

|         |             |   (hh:mm:ss)   |     Loss     |   Accuracy   |     RMSE     |      Rate       |

|=======================================================================================================|

|       1 |           1 |       00:00:01 |          NaN |        0.00% |          NaN |      1.0000e-20 |

|       5 |           5 |       00:01:22 |          NaN |        0.00% |          NaN |      1.0000e-20 |

|=======================================================================================================|

Step 4 of 4: Re-training Fast R-CNN using updated RPN.

--> Extracting region proposals from 16 training images...done.

Training on single CPU.

|=======================================================================================================|

|  Epoch  |  Iteration  |  Time Elapsed  |  Mini-batch  |  Mini-batch  |  Mini-batch  |  Base Learning  |

|         |             |   (hh:mm:ss)   |     Loss     |   Accuracy   |     RMSE     |      Rate       |

|=======================================================================================================|

|       1 |           1 |       00:00:01 |          NaN |      100.00% |          NaN |      1.0000e-20 |

|       5 |           5 |       00:01:36 |          NaN |      100.00% |          NaN |      1.0000e-20 |

|=======================================================================================================|

Detector training complete (with warnings):

警告: Step 1: The training loss has NaN values. The detector may not be properly trained. Try to lower the 'InitialLearnRate'

using the trainingOptions function and retrain the detector.

警告: Step 2: The training loss has NaN values. The detector may not be properly trained. Try to lower the 'InitialLearnRate'

using the trainingOptions function and retrain the detector.

警告: Step 3: The training loss has NaN values. The detector may not be properly trained. Try to lower the 'InitialLearnRate'

using the trainingOptions function and retrain the detector.

警告: Step 4: The training loss has NaN values. The detector may not be properly trained. Try to lower the 'InitialLearnRate'

using the trainingOptions function and retrain the detector.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值