YOLOv3新增1个分类,但EVAL出现nan的异常:EVAL: Class 10: Recall: nan, Precision: 0.0000, AP: nan

在YOLOv3模型训练中,增加一个分类后,EVAL阶段遇到问题,Class 10的Recall和Precision均为nan,AP也显示为nan。原因可能是验证集中包含了训练集数据,导致评估结果异常。解决方案是确保训练集和验证集数据互不重叠。
摘要由CSDN通过智能技术生成

Recall值, AP值,是从val文件(验证集文件)读取验证数据,所以在训练的是时候,不仅要把“新增的1个分类”验证数据添加到验证集文件,另外要确保 “训练集的数据” 不包含在“验证集的数据中”,否则会出现如下大多数的Class的AP为1的情况。

======> Epoch: 40, global_step: 37227.0, lr: 3e-05 <======
EVAL: Class 0: Recall: 1.0000, Precision: 0.0785, AP: 0.9992
EVAL: Class 1: Recall: 1.0000, Precision: 0.0419, AP: 1.0000
EVAL: Class 2: Recall: 1.0000, Precision: 0.1106, AP: 1.0000
EVAL: Class 3: Recall: 1.0000, Precision: 0.0095, AP: 1.0000
EVAL: Class 4: Recall: 1.0000, Precision: 0.0397, AP: 1.0000
EVAL: Class 5: Recall: 1.0000, Precision: 0.0043, AP: 1.0000
EVAL: Class 6: Recall: 1.0000, Precision: 0.0293, AP: 1.0000
EVAL: Class 7: Recall: 1.0000, Precision: 0.0626, AP: 1.0000
EVAL: Class 8: Recall: 0.9952, Precision: 0.0554, AP: 0.9950
EVAL: Class 9: Recall: 0.9865, Precision: 0.0084, AP: 0.9802
EVAL: Class 10: Recall: nan, Precision: 0.0000, AP: nan
EVAL: Recall: nan, Precison: 0.0347, mAP: nan
EVAL: loss: total: 0.32, xy: 0.04, wh: 0.02, conf: 0.02, class: 0.24

  8%|#########5                                                                                                              | 72/908 [00:12<02:18,  6.02it/s]Epoch: 41, global_step: 37300 | loss: total: 0.33, xy: 0.05, wh: 0.03, conf: 0.03, class: 0.23 | Last batch: rec: 1.000, prec: 0.043 | lr: 3e-05
 19%|######################5                                                                                                | 172/908 [00:28<02:03,  5.94it/s]Epoch: 41, global_step: 37400 | loss: total: 0.33, xy: 0.05, wh: 0.02, conf: 0.03, class: 0.23 | Last batch: rec: 1.000, prec: 0.035 | lr: 3e-05
 30%|###################################6                                                                                   | 272/908 [00:45<01:45,  6.01it/s]Epoch: 41, global_step: 37500 | loss: total: 0.34, xy: 0.05, wh: 0.03, conf: 0.03, class: 0.24 | Last batch: rec: 1.000, prec: 0.030 | lr: 3e-05
 41%|################################################7                                                                      | 372/908 [01:02<01:29,  5.96it/s]Epoch: 41, global_step: 37600 | loss: total: 0.34, xy: 0.05, wh: 0.03, conf: 0.03, class: 0.24 | Last batch: rec: 1.000, prec: 0.022 | lr: 3e-05
 52%|#############################################################8                                                         | 472/908 [01:18<01:12,  6.04it/s]Epoch: 41, global_step: 37700 | loss: total: 0.34, xy: 0.05, wh: 0.03, conf: 0.03, class: 0.24 | Last batch: rec: 1.000, prec: 0.036 | lr: 3e-05
 63%|##########################################################################9                                            | 572/908 [01:35<00:55,  6.01it/s]Epoch: 41, global_step: 37800 | loss: total: 0.34, xy: 0.05, wh: 0.03, conf: 0.03, class: 0.24 | Last batch: rec: 1.000, prec: 0.030 | lr: 3e-05
 74%|########################################################################################                               | 672/908 [01:52<00:39,  6.03it/s]Epoch: 41, global_step: 37900 | loss: total: 0.33, xy: 0.05, wh: 0.03, conf: 0.03, class: 0.23 | Last batch: rec: 1.000, prec: 0.057 | lr: 3e-05
 85%|#####################################################################################################1                 | 772/908 [02:08<00:22,  5.92it/s]Epoch: 41, global_step: 38000 | loss: total: 0.33, xy: 0.05, wh: 0.03, conf: 0.03, class: 0.23 | Last batch: rec: 1.000, prec: 0.047 | lr: 3e-05
 96%|##################################################################################################################2    | 872/908 [02:25<00:05,  6.02it/s]Epoch: 41, global_step: 38100 | loss: total: 0.33, xy: 0.05, wh: 0.03, conf: 0.03, class: 0.23 | Last batch: rec: 1.000, prec: 0.037 | lr: 3e-05
100%|#######################################################################################################################| 908/908 [02:31<00:00,  6.27it/s]
  7%|########4                                                                                                               | 64/908 [00:10<02:21,  5.97it/s]Epoch: 42, global_step: 38200 | loss: total: 0.34, xy: 0.05, wh: 0.03, conf: 0.03, class: 0.24 | Last batch: rec: 1.000, prec: 0.029 | lr: 3e-05
 18%|#####################4                                                                                                 | 164/908 [00:27<02:04,  5.96it/s]Epoch: 42, global_step: 38300 | loss: total: 0.34, xy: 0.05, wh: 0.03, conf: 0.03, class: 0.24 | Last batch: rec: 1.000, prec: 0.034 | lr: 3e-05
 29%|##################################5                                                                                    | 264/908 [00:44<01:47,  5.98it/s]Epoch: 42, global_step: 38400 | loss: total: 0.34, xy: 0.05, wh: 0.03, conf: 0.03, class: 0.24 | Last batch: rec: 1.000, prec: 0.016 | lr: 3e-05
 40%|###############################################7                                                                       | 364/908 [01:00<01:30,  5.99it/s]Epoch: 42, global_step: 38500 | loss: total: 0.34, xy: 0.05, wh: 0.03, conf: 0.03, class: 0.24 | Last batch: rec: 1.000, prec: 0.032 | lr: 3e-05
 51%|############################################################8                                                          | 464/908 [01:17<01:13,  6.05it/s]Epoch: 42, global_step: 38600 | loss: total: 0.34, xy: 0.05, wh: 0.03, conf: 0.03, class: 0.24 | Last batch: rec: 1.000, prec: 0.037 | lr: 3e-05
 62%|#########################################################################9                                             | 564/908 [01:34<00:57,  6.00it/s]Epoch: 42, global_step: 38700 | loss: total: 0.34, xy: 0.05, wh: 0.03, conf: 0.03, class: 0.24 | Last batch: rec: 1.000, prec: 0.038 | lr: 3e-05
 73%|#######################################################################################                                | 664/908 [01:50<00:40,  5.95it/s]Epoch: 42, global_step: 38800 | loss: total: 0.33, xy: 0.05, wh: 0.03, conf: 0.03, class: 0.23 | Last batch: rec: 1.000, prec: 0.037 | lr: 3e-05
 84%|####################################################################################################1                  | 764/908 [02:07<00:24,  6.00it/s]Epoch: 42, global_step: 38900 | loss: total: 0.33, xy: 0.05, wh: 0.03, conf: 0.03, class: 0.23 | Last batch: rec: 1.000, prec: 0.035 | lr: 3e-05
 95%|#################################################################################################################2     | 864/908 [02:24<00:07,  6.02it/s]Epoch: 42, global_step: 39000 | loss: total: 0.33, xy: 0.05, wh: 0.03, conf: 0.03, class: 0.23 | Last batch: rec: 1.000, prec: 0.033 | lr: 3e-05
100%|#######################################################################################################################| 908/908 [02:31<00:00,  6.22it/s]
100%|#######################################################################################################################| 870/870 [00:28<00:00, 30.84it/s]
======> Epoch: 42, global_step: 390
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值