bubbliiiing / faster-rcnn-pytorch

这是一个faster-rcnn的pytorch实现的库,可以利用voc数据集格式的数据进行训练。
MIT License
1.6k stars 357 forks source link

未检测到任何目标。 #200

Open dingyan-dy opened 10 months ago

dingyan-dy commented 10 months ago

您好,我前面按照流程生成了自己的数据集,训练过程中出现下列现象,显示所有评估参数为0而且未检测到任何目标,想问下有没有人知道这可能是什么原因呀? `Number of devices: 1 initialize network with normal type Configurations:

| keys | values|

| classes_path | model_data/voc_classes_custom.txt| | model_path | | | input_shape | [640, 640]| | Init_Epoch | 0| | Freeze_Epoch | 50| | UnFreeze_Epoch | 300| | Freeze_batch_size | 4| | Unfreeze_batch_size | 16| | Freeze_Train | False| | Init_lr | 0.01| | Min_lr | 0.0001| | optimizer_type | sgd| | momentum | 0.9| | lr_decay_type | cos| | save_period | 5| | save_dir | logs| | num_workers | 1| | num_train | 743| | num_val | 83|

[Warning] 使用sgd优化器时,建议将训练总步长设置到50000以上。 [Warning] 本次运行的总训练数据量为743,Unfreeze_batch_size为16,共训练300个Epoch,计算出总训练步长为13800。 [Warning] 由于总训练步长为13800,小于建议总步长50000,建议设置总世代为1087。 Start Train Epoch 1/300: 100%|██████████| 46/46 [05:55<00:00, 7.72s/it, lr=0.001, roi_cls=1.61, roi_loc=0.0249, rpn_cls=0.672, rpn_loc=3.64, total_loss=5.95] Finish Train Start Validation Epoch 1/300: 100%|██████████| 5/5 [00:17<00:00, 3.49s/it, val_loss=4.6] Finish Validation Epoch:1/300 Total Loss: 5.947 || Val Loss: 4.604 Save best model to best_epoch_weights.pth Start Train Epoch 2/300: 100%|██████████| 46/46 [04:39<00:00, 6.08s/it, lr=0.002, roi_cls=0.588, roi_loc=0.00784, rpn_cls=0.297, rpn_loc=1.15, total_loss=2.04] Finish Train Start Validation Epoch 2/300: 100%|██████████| 5/5 [00:17<00:00, 3.43s/it, val_loss=1.44] Finish Validation Epoch:2/300 Total Loss: 2.037 || Val Loss: 1.437 Save best model to best_epoch_weights.pth Start Train Epoch 3/300: 100%|██████████| 46/46 [04:41<00:00, 6.13s/it, lr=0.005, roi_cls=0.372, roi_loc=0.0246, rpn_cls=0.106, rpn_loc=0.923, total_loss=1.43] Epoch 3/300: 0%| | 0/5 [00:00<?, ?it/s<class 'dict'>]Finish Train Start Validation Epoch 3/300: 100%|██████████| 5/5 [00:17<00:00, 3.41s/it, val_loss=1.35] Finish Validation Epoch:3/300 Total Loss: 1.426 || Val Loss: 1.347 Save best model to best_epoch_weights.pth Epoch 4/300: 0%| | 0/46 [00:00<?, ?it/s<class 'dict'>]Start Train Epoch 4/300: 100%|██████████| 46/46 [04:33<00:00, 5.94s/it, lr=0.01, roi_cls=0.368, roi_loc=0.0269, rpn_cls=0.0975, rpn_loc=0.924, total_loss=1.42] Finish Train Start Validation Epoch 4/300: 100%|██████████| 5/5 [00:17<00:00, 3.51s/it, val_loss=1.36] Finish Validation Epoch:4/300 Total Loss: 1.416 || Val Loss: 1.362 Start Train Epoch 5/300: 100%|██████████| 46/46 [04:58<00:00, 6.49s/it, lr=0.01, roi_cls=0.363, roi_loc=0.0299, rpn_cls=0.095, rpn_loc=0.943, total_loss=1.43] Finish Train Start Validation Epoch 5/300: 100%|██████████| 5/5 [00:18<00:00, 3.72s/it, val_loss=1.34] Finish Validation 0%| | 0/83 [00:00<?, ?it/s]Get map. 100%|██████████| 83/83 [04:36<00:00, 3.33s/it] Calculate Map. loading annotations into memory... Done (t=0.00s) creating index... index created! Loading and preparing results... DONE (t=0.00s) creating index... index created! Running per image evaluation... Evaluate annotation type bbox DONE (t=0.15s). Accumulating evaluation results... DONE (t=0.06s). Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.000 Average Precision (AP) @[ IoU=0.50 | area= all | maxDets=100 ] = 0.000 Average Precision (AP) @[ IoU=0.75 | area= all | maxDets=100 ] = 0.000 Average Precision (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.000 Average Precision (AP) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.000 Average Precision (AP) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.000 Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 1 ] = 0.000 Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 10 ] = 0.000 Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.000 Average Recall (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = 0.000 Average Recall (AR) @[ IoU=0.50:0.95 | area=medium | maxDets=100 ] = 0.000 Average Recall (AR) @[ IoU=0.50:0.95 | area= large | maxDets=100 ] = 0.000 Get map done. Epoch:5/300 Total Loss: 1.430 || Val Loss: 1.335 Save best model to best_epoch_weights.pth Epoch 6/300: 0%| | 0/46 [00:00<?, ?it/s<class 'dict'>]Start Train Epoch 6/300: 100%|██████████| 46/46 [04:59<00:00, 6.50s/it, lr=0.01, roi_cls=0.358, roi_loc=0.0236, rpn_cls=0.0947, rpn_loc=0.903, total_loss=1.38] Epoch 6/300: 0%| | 0/5 [00:00<?, ?it/s<class 'dict'>]Finish Train Start Validation Epoch 6/300: 100%|██████████| 5/5 [00:17<00:00, 3.44s/it, val_loss=1.31] Finish Validation Epoch:6/300 Total Loss: 1.379 || Val Loss: 1.307 Save best model to best_epoch_weights.pth Start Train Epoch 7/300: 100%|██████████| 46/46 [04:23<00:00, 5.73s/it, lr=0.01, roi_cls=0.365, roi_loc=0.038, rpn_cls=0.095, rpn_loc=0.888, total_loss=1.39] Epoch 7/300: 0%| | 0/5 [00:00<?, ?it/s<class 'dict'>]Finish Train Start Validation Epoch 7/300: 100%|██████████| 5/5 [00:13<00:00, 2.77s/it, val_loss=1.37] Finish Validation Epoch:7/300 Total Loss: 1.386 || Val Loss: 1.371 Start Train Epoch 8/300: 100%|██████████| 46/46 [04:51<00:00, 6.34s/it, lr=0.01, roi_cls=0.363, roi_loc=0.0421, rpn_cls=0.0933, rpn_loc=0.929, total_loss=1.43] Epoch 8/300: 0%| | 0/5 [00:00<?, ?it/s<class 'dict'>]Finish Train Start Validation Epoch 8/300: 100%|██████████| 5/5 [00:17<00:00, 3.47s/it, val_loss=1.35] Finish Validation Epoch:8/300 Total Loss: 1.428 || Val Loss: 1.354 Start Train Epoch 9/300: 100%|██████████| 46/46 [04:49<00:00, 6.29s/it, lr=0.00999, roi_cls=0.359, roi_loc=0.0452, rpn_cls=0.094, rpn_loc=0.921, total_loss=1.42] Epoch 9/300: 0%| | 0/5 [00:00<?, ?it/s<class 'dict'>]Finish Train Start Validation Epoch 9/300: 100%|██████████| 5/5 [00:17<00:00, 3.48s/it, val_loss=1.34] Finish Validation Epoch:9/300 Total Loss: 1.419 || Val Loss: 1.340 Start Train Epoch 10/300: 100%|██████████| 46/46 [04:25<00:00, 5.78s/it, lr=0.00999, roi_cls=0.362, roi_loc=0.0391, rpn_cls=0.0923, rpn_loc=0.906, total_loss=1.4] Finish Train Start Validation Epoch 10/300: 100%|██████████| 5/5 [00:17<00:00, 3.43s/it, val_loss=1.41] Finish Validation Get map. 100%|██████████| 83/83 [01:01<00:00, 1.35it/s] Calculate Map. 未检测到任何目标。 Get map done. Epoch:10/300 Total Loss: 1.399 || Val Loss: 1.411 `

Link20A commented 9 months ago

你好,请问你解决了吗

dingyan-dy commented 9 months ago

貌似记得是因为我的数据集问题,没有训练上。后来因为名称不规范我重新从0000序号重命名后转化成voc格式的(ps:不好意思 有点久了 记不太清了)发自我的手机-------- 原始邮件 --------发件人: Link20A @.>日期: 2024年2月27日周二 晚上7:17收件人: bubbliiiing/faster-rcnn-pytorch @.>抄送: Jingle @.>, Author @.>主 题: Re: [bubbliiiing/faster-rcnn-pytorch] 未检测到任何目标。 (Issue #200) 你好,请问你解决了吗

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

csycvtsbcsbbbycsb commented 8 months ago

你好,请问你解决了吗

你好,你现在解决了吗

maige1219 commented 6 months ago

后来因为名称不规范我重新从0000序号重命名后转化成voc格式

请问原来的命名格式是什么样子的?我似乎也遇到了类似的问题...loss值基本上为0,我怀疑是roboflow搞的鬼 epoch_loss 如图,roboflow会把下载的图片都加上后缀 image