You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
自制测试集原本有251张数据,后新增至300张。训练集也新增千张,在训练时并未出错。但后续用
python tools/voc_eval.py result/yolox/results10.pkl work_dirs/yolox_l_8x8_300e_coco/yolox_l_8x8_300e_coco.py
命令,voc_eval.py是我从网上找的,之前老版本的用voc标准计算map的代码。
后报错:assert len(det_results) == len(annotations) AssertionError
原文如下:
python tools/voc_eval.py result/yolox/results10.pkl work_dirs/yolox_l_8x8_300e_coco/yolox_l_8x8_300e_coco.py
/home/liu/anaconda3/envs/openmmlab/lib/python3.8/site-packages/mmcv/init.py:20: UserWarning: On January 1, 2023, MMCV will release v2.0.0, in which it will remove components related to the training process and add a data transformation module. In addition, it will rename the package names mmcv to mmcv-lite and mmcv-full to mmcv. See https://github.com/open-mmlab/mmcv/blob/master/docs/en/compatibility.md for more details.
warnings.warn(
loading annotations into memory...
Done (t=0.00s)
creating index...
index created!
300// 此行为我打印的len(det_results)
251// 此行为我打印的len(annotations)
CocoDataset Train dataset with number of images 251, and instance counts:
+-------------------+-------+-------------+-------+---------------+-------+------------------+-------+-------------+-------+
| category | count | category | count | category | count | category | count | category | count |
+-------------------+-------+-------------+-------+---------------+-------+------------------+-------+-------------+-------+
| 0 [diaoche] | 57 | 1 [tadiao] | 202 | 2 [fandouche] | 66 | 3 [bengche] | 3 | 4 [wajueji] | 146 |
| 5 [gonggongqiche] | 0 | 6 [tuituji] | 36 | 7 [qiche] | 0 | 8 [qitacheliang] | 15 | 9 [shanhuo] | 3 |
| | | | | | | | | | |
| 10 [yanwu] | 41 | | | | | | | | |
+-------------------+-------+-------------+-------+---------------+-------+------------------+-------+-------------+-------+
// 上述为我打印的datasets
Traceback (most recent call last):
File "tools/voc_eval.py", line 51, in
main()
File "tools/voc_eval.py", line 47, in main
voc_eval(args.result, test_dataset, args.iou_thr, args.nproc)
File "tools/voc_eval.py", line 20, in voc_eval
eval_map(
File "/home/liu/Gyb/mmdetection/mmdet/core/evaluation/mean_ap.py", line 579, in eval_map
assert len(det_results) == len(annotations)
AssertionError
请问在哪里将测试集数据修改为300张,每次测试时总是报这个错误,我并未找到有直接赋值测试集数量的地方,不知道是哪里出了问题,还请指教。(注,coco格式的test.json文件我已更新为测试集增加至300张后的。)
Beta Was this translation helpful? Give feedback.
All reactions