-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Fix numpy 1.20+ deprecation warnings #42929
Fix numpy 1.20+ deprecation warnings #42929
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
2be10d5
to
17e3efb
Compare
17e3efb
to
d3b6321
Compare
d3b6321
to
b482948
Compare
python/paddle/fluid/tests/unittests/mkldnn/test_softmax_bf16_mkldnn_op.py
Show resolved
Hide resolved
python/paddle/fluid/tests/unittests/npu/test_density_prior_box_op_npu.py
Show resolved
Hide resolved
python/paddle/fluid/tests/unittests/xpu/test_prior_box_op_xpu.py
Outdated
Show resolved
Hide resolved
b482948
to
eb4d04d
Compare
@qili93 There are many of CI failures after changing |
Got it, I will double confirm the failure CI test cases. |
hi @zlsh80826 Double confirmed Paddle code, the root cause is :
And the reason np.float64 works is : So propose to keep all the I have tried to add a similar function to handle Apologize for my previous comment is not correct. Thanks! |
Sorry to inform you that eb4d04d's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
eb4d04d
to
aa3d10d
Compare
hi, @zlsh80826 Seems some code style check failed in CI, propose to use this docker image to run git commit command, it will use clang-format installed in docker to format the code style automatically. nvidia-docker run -it --name paddle-dev -v `pwd`:/workspace \
--network=host --shm-size=128G --workdir=/workspace \
--cap-add=SYS_PTRACE --security-opt seccomp=unconfined \
registry.baidubce.com/paddlepaddle/paddle:latest-dev-cuda11.2-cudnn8-gcc82 /bin/bash
# install pre-commit inside container
pip3 install pre-commit
# then clang-format will format the code style automatically
git commit -m "......" |
34ea207
to
29e8d95
Compare
Hi @qili93, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* Replace np.bool/np.bool8 with np.bool_ * Replace np.object with np.object_ * Replace np.complex with np.complex128 * Replace np.float with np.float64 * Replace np.int with np.int_ * Rerun pre-commit for newer pre-commit configuration * Use builtin bool instead of np.bool_ based on the context
* Fix numpy 1.20+ deprecation warnings (#42929) * Replace np.bool/np.bool8 with np.bool_ * Replace np.object with np.object_ * Replace np.complex with np.complex128 * Replace np.float with np.float64 * Replace np.int with np.int_ * Rerun pre-commit for newer pre-commit configuration * Use builtin bool instead of np.bool_ based on the context * fix mode dtype Co-authored-by: zlsh80826 <rewang@nvidia.com>
PR types
Bug fixes
PR changes
Others
Describe
np.bool
,np.int
,np.float
,np.complex
,np.object
,np.str
,np.long
,np.unicode
are deprecated. There are tons of warnings during Paddle runs, those warnings are very distracting. This PR makes following changesReplace
np.bool
/np.bool8
withnp.bool_
Replace
np.object
withnp.object_
Replace
np.complex
withnp.complex128
Replace
np.float
withnp.float64
Replace
np.int
withnp.int_
See https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations for more details.
Tensorflow alredy adopted the change last year
Related issue: paddle2.2.2创建张量时遇到NumPy弃用警告:DeprecationWarning #41745
Besides this PR, we should notify all developers that not to use the deprecated aliases