YOLOX icon indicating copy to clipboard operation
YOLOX copied to clipboard

ap始终为0

Open hhngdcz opened this issue 4 years ago • 24 comments

python tools/train.py -f exps/example/yolox_voc/yolox_voc_x.py -d 1 -b 6 -o -c weights/yolox_x.pth.tar

Eval IoU : 0.50 /content/gdrive/MyDrive/YOLOX/Yolox/evaluators/voc_eval.py:179: RuntimeWarning: invalid value encountered in true_divide rec = tp / float(npos) AP for cucumber_mildew_fungus = 0.0000 Mean AP = 0.0000

Results:
0.000
0.000

Results computed with the unofficial Python eval code. Results should be very close to the official MATLAB eval code. Recompute with ./tools/reval.py --matlab ... for your paper. -- Thanks, The Management

Eval IoU : 0.55 Eval IoU : 0.60 Eval IoU : 0.65 Eval IoU : 0.70 Eval IoU : 0.75 Eval IoU : 0.80 Eval IoU : 0.85 Eval IoU : 0.90 Eval IoU : 0.95

map_5095: 0.0 map_50: 0.0

hhngdcz avatar Aug 03 '21 14:08 hhngdcz

我也是训练时测试AP=0,而且LOSS在10附近震荡,我把训练标注框画在图上是对的。

wanghanyang123 avatar Aug 04 '21 05:08 wanghanyang123

pull the latest updates and try again. We fix some bug days ago #275

GOATmessi8 avatar Aug 04 '21 15:08 GOATmessi8

same problem even with latest updates. Checked that the labels is correct.

luvwinnie avatar Aug 05 '21 07:08 luvwinnie

me too

TUDelftHao avatar Aug 05 '21 07:08 TUDelftHao

有人找到这个问题了吗

shineway14 avatar Aug 05 '21 09:08 shineway14

请问有人解决了吗

qingshanjiu avatar Aug 05 '21 09:08 qingshanjiu

Any solution with this?

luvwinnie avatar Aug 05 '21 10:08 luvwinnie

拉取最新更新并重试。我们几天前修复了一些错误#275

拉取最新的重试后也是那样

hhngdcz avatar Aug 05 '21 15:08 hhngdcz

Me too!Why? The format of my datasets is XML ,is same as VOC.

Michael-YYang avatar Aug 06 '21 00:08 Michael-YYang

2021-08-05 19:03:18.410 | INFO | yolox.core.trainer:before_epoch:193 - ---> start train epoch300 2021-08-05 19:03:21.105 | INFO | yolox.core.trainer:after_iter:246 - epoch: 300/300, iter: 10/27, mem: 10161Mb, iter_time: 0.269s, data_time: 0.002s, total_loss: 5.5, iou_loss: 1.9, l1_loss: 0.8, conf_loss: 2.0, cls_loss: 0.8, lr: 6.250e-05, size: 672, ETA: 0:00:05 2021-08-05 19:03:24.223 | INFO | yolox.core.trainer:after_iter:246 - epoch: 300/300, iter: 20/27, mem: 10161Mb, iter_time: 0.311s, data_time: 0.001s, total_loss: 6.2, iou_loss: 2.3, l1_loss: 1.0, conf_loss: 2.2, cls_loss: 0.8, lr: 6.250e-05, size: 576, ETA: 0:00:02 2021-08-05 19:03:26.326 | INFO | yolox.core.trainer:save_ckpt:322 - Save weights to ./YOLOX_outputs/yolox_voc_s 2021-08-05 19:03:27.583 | INFO | yolox.evaluators.voc_evaluator:evaluate_prediction:161 - Evaluate in main process... 2021-08-05 19:03:28.087 | INFO | yolox.core.trainer:evaluate_and_save_model:313 - Average forward time: 10.16 ms, Average NMS time: 0.79 ms, Average inference time: 10.96 ms

2021-08-05 19:03:28.087 | INFO | yolox.core.trainer:save_ckpt:322 - Save weights to ./YOLOX_outputs/yolox_voc_s 2021-08-05 19:03:28.344 | INFO | yolox.core.trainer:after_train:186 - Training of experiment is done and the best AP is 0.00

Michael-YYang avatar Aug 06 '21 00:08 Michael-YYang

Training of experiment is done and the best AP is 0.00 我的AP也是0,现在已经可以了,我的问题原因是coco的数据集中的categories的id是从0开始设置的,改成从1开始就可以了

2021-08-07 13:17:00 | INFO | yolox.core.trainer:306 - Average forward time: 1.37 ms, Average NMS time: 1.65 ms, Average inference time: 3.03 ms Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.009 Average Precision (AP) @[ IoU=0.50 | area= all | maxDets=100 ] = 0.015 Average Precision (AP) @[ IoU=0.75 | area= all | maxDets=100 ] = 0.008 Average Precision (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = -1.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.009 Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 1 ] = 0.019 Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 10 ] = 0.032 Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.033 Average Recall (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = -1.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.033 2021-08-07 13:17:00 | INFO | yolox.core.trainer:315 - Save weights to ./YOLOX_outputs/nano 2021-08-07 13:17:00 | INFO | yolox.core.trainer:185 - Training of experiment is done and the best AP is 0.88 希望对大家帮助

sunlinlin-aragon avatar Aug 07 '21 13:08 sunlinlin-aragon

如果是voc数据集的话,把voc.py中54行左右的name = obj.find("name").text.lower().strip()改成name = obj.find("name").text.strip()试试

hhngdcz avatar Aug 07 '21 14:08 hhngdcz

请问有人解决了吗

我已经发现原因了

MangoloD avatar Aug 12 '21 04:08 MangoloD

有人找到这个问题了吗

已解决

MangoloD avatar Aug 12 '21 04:08 MangoloD

Me too!Why? The format of my datasets is XML ,is same as VOC.

I have found the reason and solved it

MangoloD avatar Aug 12 '21 04:08 MangoloD

Any solution with this?

I have solved it

MangoloD avatar Aug 12 '21 04:08 MangoloD

Training of experiment is done and the best AP is 0.00 我的AP也是0,现在已经可以了,我的问题原因是coco的数据集中的categories的id是从0开始设置的,改成从1开始就可以了

2021-08-07 13:17:00 | INFO | yolox.core.trainer:306 - Average forward time: 1.37 ms, Average NMS time: 1.65 ms, Average inference time: 3.03 ms Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.009 Average Precision (AP) @[ IoU=0.50 | area= all | maxDets=100 ] = 0.015 Average Precision (AP) @[ IoU=0.75 | area= all | maxDets=100 ] = 0.008 Average Precision (AP) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = -1.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.009 Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 1 ] = 0.019 Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 10 ] = 0.032 Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets=100 ] = 0.033 Average Recall (AR) @[ IoU=0.50:0.95 | area= small | maxDets=100 ] = -1.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.033 2021-08-07 13:17:00 | INFO | yolox.core.trainer:315 - Save weights to ./YOLOX_outputs/nano 2021-08-07 13:17:00 | INFO | yolox.core.trainer:185 - Training of experiment is done and the best AP is 0.88 希望对大家帮助

我的数据格式是VOC,该怎么办呢?有没有谁是VOC格式的解决了的

nTnZone avatar Aug 16 '21 11:08 nTnZone

如果是voc数据集的话,把voc.py中54行左右的name = obj.find("name").text.lower().strip()改成name = obj.find("name").text.strip()试试

没用呢,我这边是拷贝的最新的yolox代码,那个位置已经是obj.find("name").text.strip() 。但是AP还是0

nTnZone avatar Aug 16 '21 11:08 nTnZone

Me too!Why? The format of my datasets is XML ,is same as VOC.

I have found the reason and solved it

你是怎么解决的呢?

nTnZone avatar Aug 16 '21 11:08 nTnZone

Me too!Why? The format of my datasets is XML ,is same as VOC.

I have found the reason and solved it

你是怎么解决的呢?

解决YOLOX训练时AP为0

MangoloD avatar Aug 17 '21 03:08 MangoloD

我也是训练时测试AP=0,而且LOSS在10附近震荡,我把训练标注框画在图上是对的。

same problem,did you solve it?

cena001plus avatar Oct 22 '21 12:10 cena001plus

有人解决了吗?

我已经发现原因了 你倒是说怎么解决的

gaobo25 avatar Mar 17 '22 10:03 gaobo25

我也出现了上述情况,训练第一批次时,各个类别的ap都不现实直接打印best ap = 0 ,这个问题困扰了我一周,到现在终于解决了,解决方法为一个百度文库的大佬写的文档,希望可以帮到大家:https://wenku.baidu.com/view/bcf57d034835eefdc8d376eeaeaad1f34693111a.html

xiaodu0414 avatar Jun 10 '22 07:06 xiaodu0414

hey guys what is the solution?

adosash avatar May 20 '25 12:05 adosash