PaddleOCR2Pytorch icon indicating copy to clipboard operation
PaddleOCR2Pytorch copied to clipboard

运行例子出错,需要修改代码适配NumPy 1.24

Open weiweijeff opened this issue 11 months ago • 1 comments

File "D:\cvrd\PaddleOCR2Pytorch\pytorchocr\postprocess\db_postprocess.py", line 127, in box_score_fast xmin = np.clip(np.floor(box[:, 0].min()).astype(np.int), 0, w - 1) 原因是: numpy.int was deprecated in NumPy 1.20 and was removed in NumPy 1.24. You can change it to numpy.int_, or just int. 原文出处 处理方式:将127行开始的4个np.int替换成int就行了

weiweijeff avatar Mar 19 '24 14:03 weiweijeff

https://stackoverflow.com/questions/74946845/attributeerror-module-numpy-has-no-attribute-int

numpy.int was deprecated in NumPy 1.20 and was removed in NumPy 1.24.

Quick temp fix (until code is updated from numpy.int to numpy.int_ or just int): pip install 'numpy<1.24'

kulogix avatar Mar 24 '24 09:03 kulogix