VikParuchuri / surya

OCR, layout analysis, reading order, table recognition in 90+ languages
https://www.datalab.to
GNU General Public License v3.0
14.35k stars 899 forks source link

failed assertion `Placeholder shape mismatches (expected 1 vs got tensorData with 896) at dimIdx = 0' when recognizing text #216

Closed gaowq2017 closed 1 month ago

gaowq2017 commented 1 month ago

The detial as follow: OS: Max os, chip: M1 ErrorLog: Loaded detection model vikp/surya_det3 on device mps with dtype torch.float16 Loaded recognition model vikp/surya_rec2 on device mps with dtype torch.float16 Detecting bboxes: 100%|██████████| 1/1 [00:00<00:00, 1.55it/s] Recognizing Text: 0%| | 0/1 [00:00<?, ?it/s]/AppleInternal/Library/BuildRoots/d9889869-120b-11ee-b796-7a03568b17ac/Library/Caches/com.apple.xbs/Sources/MetalPerformanceShadersGraph/mpsgraph/MetalPerformanceShadersGraph/Core/Files/MPSGraph.mm:678: failed assertion `Placeholder shape mismatches (expected 1 vs got tensorData with 896) at dimIdx = 0' /Users/theoyu/miniforge3/envs/py310/lib/python3.10/multiprocessing/resource_tracker.py:224: UserWarning: resource_tracker: There appear to be 1 leaked semaphore objects to clean up at shutdown warnings.warn('resource_tracker: There appear to be %d ' Thank you!

VikParuchuri commented 1 month ago

This is an MPS bug, should be fixed with the newest version of surya, make sure you do pip install -U

gaowq2017 commented 1 month ago

This is an MPS bug, should be fixed with the newest version of surya, make sure you do pip install -U

@VikParuchuri OK, thank you very much!