Open ThorPham opened 2 years ago
Have you modified your config/code by any chance?
@gaotongxiao I only change file config for custom dataset. I eval successful on DBnet model for same data but on MaskRCNN and FCENet it's appear error. Can you guess where is the problem .
Could you share all the parts that you've modified following the issue template?
I just clone and install mmocr again But still remain error. I only change data in file config . `base = [ '../../base/runtime_10e.py', '../../base/det_models/ocr_mask_rcnn_r50_fpn_ohem.py', '../../base/schedules/schedule_sgd_160e.py', '../../base/det_datasets/icdar2015.py', '../../base/det_pipelines/maskrcnn_pipeline.py' ]
train_list = {{base.train_list}} test_list = {{base.test_list}}
train_pipeline = {{base.train_pipeline}} test_pipeline_icdar2015 = {{base.test_pipeline_icdar2015}}
dataset_type = 'IcdarDataset' data_root = '/home/thorpham/Documents/mmocr/data/'
data = dict( samples_per_gpu=8, workers_per_gpu=4, val_dataloader=dict(samples_per_gpu=4), test_dataloader=dict(samples_per_gpu=2), train=dict( type=dataset_type, ann_file=data_root + '/instances_training.json', img_prefix=data_root + '/imgs', pipeline=train_pipeline), val=dict( type=dataset_type, ann_file=data_root + '/instances_test.json', img_prefix=data_root + '/imgs', pipeline=test_pipeline_icdar2015), test=dict( type=dataset_type, ann_file=data_root + '/instances_val.json', img_prefix=data_root + '/imgs', pipeline=test_pipeline_icdar2015))
evaluation = dict(interval=10, metric='hmean-iou')`
Sorry for causing the inconvenience, I'm sure it's a bug on the batch inference of some models. We'll look into this one soon. For now, the workaround of this problem is setting test_dataloader=dict(samples_per_gpu=1)
.
@gaotongxiao Thank you for support. It's work.
Reopening it for the backlog :)
I have 500 images to evaluation and cmd i run :
python tools/test.py /home/thorpham/Documents/mmocr/configs/textdet/maskrcnn/mask_rcnn_r50_fpn_160e_icdar2015.py /home/thorpham/Documents/mmocr/paper/maskCNN/epoch_10.pth --eval hmean-iou
error appear : `File "tools/test.py", line 322, in main print(dataset.evaluate(outputs, **eval_kwargs)) File "/home/thorpham/Documents/mmocr/mmocr/datasets/icdar_dataset.py", line 157, in evaluate rank_list=rank_list) File "/home/thorpham/Documents/mmocr/mmocr/core/evaluation/hmean.py", line 103, in eval_hmean assert len(results) == len(img_infos) == len(ann_infos) AssertionError` I check function eval len(results) only 250 but i have 500 images lead to results length difference img_infos length. I don't know why it's eval only a half dataset.![Screenshot from 2022-03-12 22-23-17](https://user-images.githubusercontent.com/33828708/158024099-f49f9e52-1241-41e6-85e7-f74f90caba5c.png)