JiaquanYe / TableMASTER-mmocr

2nd solution of ICDAR 2021 Competition on Scientific Literature Parsing, Task B.
Apache License 2.0
430 stars 103 forks source link

训练后测试报错 'TableResize is not in the pipeline registry' #16

Closed xray1111 closed 2 years ago

xray1111 commented 3 years ago

我对表格结构识别模型训练一轮后想用test_imgs.py这个脚本来测试一下模型能不能跑通,结果报了一个错,请问这是因为mmcv的版本问题吗,还是什么其他问题?谢谢!(我是用pip install mmcv-full==1.3.4 -f https://download.openmmlab.com/mmcv/dist/cu102/torch1.7.0/index.html这个命令安装mmcv的, mmocr是通过在当前repo的根路径下运行pip install -v -e .安装的,安装后mmocr的版本是0.2.0)

python tools/test_imgs.py configs/textrecog/master/table_master_ResnetExtract_Ranger_0705.py experiments/mmocr_table_recognition/0705/latest.pth /home/datasets/ocr/table/pubtabnet/test /home/datasets/ocr/table/pubtabnet/test.list
Use load_from_local loader
[>>>>>>>>>>>>                                      ] 1/4, 22075.3 task/s, elapsed: 0s, ETA:     0sTraceback (most recent call last):
  File "tools/test_imgs.py", line 165, in <module>
    main()
  File "tools/test_imgs.py", line 151, in main
    result = inference_detector(model, img_path)
  File "/home/xray/homework/table/TableMASTER-mmocr/mmdetection-2.11.0/mmdet/apis/inference.py", line 117, in inference_detector
    test_pipeline = Compose(cfg.data.test.pipeline)
  File "/home/xray/homework/table/TableMASTER-mmocr/mmdetection-2.11.0/mmdet/datasets/pipelines/compose.py", line 22, in __init__
    transform = build_from_cfg(transform, PIPELINES)
  File "/home/anaconda3/envs/pytorch1.7/lib/python3.6/site-packages/mmcv/utils/registry.py", line 44, in build_from_cfg
    f'{obj_type} is not in the {registry.name} registry')
KeyError: 'TableResize is not in the pipeline registry'
tangjiashan7 commented 2 years ago

你可以重新装一遍环境,再python setup.py Install 一遍,在tablemaster文件夹里面做这些工作

JiaquanYe commented 2 years ago

Your can read this issue: https://github.com/JiaquanYe/TableMASTER-mmocr/issues/6