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 version issue #13991

Open
2 tasks done
agzeroo opened this issue Oct 13, 2024 · 8 comments
Open
2 tasks done

numpy version issue #13991

agzeroo opened this issue Oct 13, 2024 · 8 comments

Comments

@agzeroo
Copy link

agzeroo commented Oct 13, 2024

🔎 Search before asking

  • I have searched the PaddleOCR Docs and found no similar bug report.
  • [] I have searched the PaddleOCR Issues and found no similar bug report.
  • I have searched the PaddleOCR Discussions and found no similar bug report.

🐛 Bug (问题描述)

Hi.
I was using numpy version 1.26.3 and there was no problem.
But when numpy version becomes 2.0 or higher, the problem occurs.
Is there any way to solve this problem as quickly as possible?
#13937 (comment)

🏃‍♂️ Environment (运行环境)

paddlepaddle-gpu 2.5.2

🌰 Minimal Reproducible Example (最小可复现问题的Demo)

@OmarFaig
Copy link

Downgrade NumPy: Since you mentioned that the problem does not occur with NumPy version 1.26.3, a temporary workaround would be to downgrade to that version:
pip install numpy==1.26.3

@agzeroo
Copy link
Author

agzeroo commented Oct 14, 2024

@OmarFaig
Thanks for the reply.

But I need to make paddleocr work in an environment where numpy 2.0 or higher is installed....

@GreatV
Copy link
Collaborator

GreatV commented Oct 14, 2024

cannot work for numpy geater than 2.0, for quick apply new numpy version, try this #13467

@agzeroo
Copy link
Author

agzeroo commented Oct 16, 2024

@GreatV

#13937 [WIP] Is there a difference between upgrade to numpy 2.0 and remove imgaug and #13467? I'm trying it, but I still don't get the result in numpy 2.0 or higher.

image

Package Version
albucore 0.0.17
albumentations 1.4.18
annotated-types 0.7.0
anyio 4.6.2
astor 0.8.1
beautifulsoup4 4.12.3
certifi 2024.8.30
charset-normalizer 3.4.0
click 8.1.7
colorama 0.4.6
contourpy 1.3.0
cycler 0.12.1
Cython 3.0.11
decorator 5.1.1
eval_type_backport 0.2.0
fastapi 0.115.2
fire 0.7.0
fonttools 4.54.1
h11 0.14.0
httpcore 1.0.6
httpx 0.27.2
idna 3.10
imageio 2.36.0
joblib 1.4.2
kiwisolver 1.4.7
lazy_loader 0.4
lmdb 1.5.1
lxml 5.3.0
matplotlib 3.9.2
networkx 3.4.1
numpy 2.1.2
opencv-contrib-python 4.10.0.84
opencv-python 4.10.0.84
opencv-python-headless 4.10.0.84
opt-einsum 3.3.0
packaging 24.1
paddleocr 2.8.1
paddlepaddle-gpu 2.5.2
pillow 10.4.0
pip 24.2
protobuf 3.20.2
pyclipper 1.3.0.post5
pydantic 2.9.2
pydantic_core 2.23.4
PyMuPDF 1.21.1
pyparsing 3.2.0
python-dateutil 2.9.0.post0
python-docx 1.1.2
python-multipart 0.0.12
PyYAML 6.0.2
RapidFuzz 3.10.0
requests 2.32.3
scikit-image 0.24.0
scikit-learn 1.5.2
scipy 1.14.1
setuptools 75.1.0
shapely 2.0.6
six 1.16.0
sniffio 1.3.1
soupsieve 2.6
starlette 0.39.2
termcolor 2.5.0
threadpoolctl 3.5.0
tifffile 2024.9.20
tomli 2.0.2
tqdm 4.66.5
typing_extensions 4.12.2
urllib3 2.2.3
uvicorn 0.31.1
wheel 0.44.0

@GreatV
Copy link
Collaborator

GreatV commented Oct 22, 2024

What's the specific numpy version issue you're facing?

@agzeroo
Copy link
Author

agzeroo commented Oct 23, 2024

@GreatV

With numpy 2.1.2, training does not occur at all (loss does not decrease) and inference with a pretrained model does not produce any results. (Running the same data with numpy 1.26.3 produces normal results.)

Trying #13467 also produced the following error, training did not occur, and inference still did not produce any results.
error1.
Error : (InvalidArgument) Broadcast dimension mismatch. Operands could not be broadcast together with the shape of X = [2, 256, 7, 7] and the shape of Y = [2, 256, 8, 8]. Received [7] in X is not equal to [8] in Y at i:2
[Hint: Expected x_dims_array[i] == y_dims_array[i] || x_dims_array[i] <= 1 || y_dims_array[i] <= 1 == true, but received x_dims_array[i] == y_dims_array[i] || x_dims_array[i] <= 1 || y_dims_array[i] <= 1:0 != true:1.] (at .. \paddle/phi/kernels/funcs/common_shape.h:86)

@GreatV
Copy link
Collaborator

GreatV commented Oct 23, 2024

That looks really weird, we'll investigate further.

@GreatV
Copy link
Collaborator

GreatV commented Nov 17, 2024

@agzeroo Please try our latest main branch to check if the issue is resolved.

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

3 participants