Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
weiweijeff opened this issue Mar 19, 2024 · 1 comment
Open

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

weiweijeff opened this issue Mar 19, 2024 · 1 comment

Comments

@weiweijeff
Copy link

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就行了

@kulogix
Copy link

kulogix commented Mar 24, 2024

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'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants