open-mmlab / mmocr

OpenMMLab Text Detection, Recognition and Understanding Toolbox
https://mmocr.readthedocs.io/en/dev-1.x/
Apache License 2.0
4.18k stars 735 forks source link

[Bug] TypeError: '>' not supported between instances of 'list' and 'float' #2006

Open CyanMystery opened 8 months ago

CyanMystery commented 8 months ago

Prerequisite

Task

I have modified the scripts/configs, or I'm working on my own tasks/models/datasets.

Branch

main branch https://github.com/open-mmlab/mmocr

Environment

sys.platform: win32 Python: 3.8.17 (default, Jul 5 2023, 20:44:21) [MSC v.1916 64 bit (AMD64)] CUDA available: True numpy_random_seed: 2147483648 GPU 0: NVIDIA GeForce GTX 1080 Ti CUDA_HOME: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2 NVCC: Cuda compilation tools, release 12.2, V12.2.140 MSVC: 用于 x64 的 Microsoft (R) C/C++ 优化编译器 19.35.32217.1 版 GCC: n/a PyTorch: 1.10.2 PyTorch compiling details: PyTorch built with:

TorchVision: 0.11.3 OpenCV: 4.6.0 MMEngine: 0.8.4 MMOCR: 1.0.1+9551af6

Reproduces the problem - code sample

from mmocr.apis import MMOCRInferencer, TextSpotInferencer

读取图像

img_path = r'1.jpg' img = cv2.imread(img_path)

inferencer = TextSpotInferencer(model=r'mmocr\work_dirs\spts_resnet50_8xb8-200e_icdar2015_original\spts_resnet50_8xb8-200e_icdar2015.py', weights=r'mmocr\work_dirs\spts_resnet50_8xb8-200e_icdar2015_original\best_generic_hmean_epoch_100.pth')

inferencer(img, save_vis=True,return_vis=True)

Reproduces the problem - command or script

from mmocr.apis import MMOCRInferencer, TextSpotInferencer

读取图像

img_path = r'1.jpg' img = cv2.imread(img_path)

inferencer = TextSpotInferencer(model=r'mmocr\work_dirs\spts_resnet50_8xb8-200e_icdar2015_original\spts_resnet50_8xb8-200e_icdar2015.py', weights=r'mmocr\work_dirs\spts_resnet50_8xb8-200e_icdar2015_original\best_generic_hmean_epoch_100.pth')

inferencer(img, save_vis=True,return_vis=True)

Reproduces the problem - error message

Inference ----------------------------------------
Traceback (most recent call last): File "mmocr\cv2demo\detect_text.py", line 11, in inferencer(img, save_vis=True,return_vis=True) File "mmocr\mmocr\apis\inferencers\base_mmocr_inferencer.py", line 194, in call visualization = self.visualize( File "\mmocr\mmocr\apis\inferencers\base_mmocr_inferencer.py", line 304, in visualize visualization = self.visualizer.add_datasample( File "mmocr\mmocr\visualization\textspotting_visualizer.py", line 120, in add_datasample pred_instances.scores > pred_score_thr].cpu().numpy() TypeError: '>' not supported between instances of 'list' and 'float'

Process finished with exit code 1

Additional information

No response

txg-GANGGANG commented 4 months ago

Have you solved your problem? I have met the same one too.