Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

[BUGFIX] Fix AttributeError: module 'numpy' has no attribute 'bool'. (#21165), builds on PR #21223 #21224

Open
mdengler wants to merge 1 commit into apache:master
base: master
Choose a base branch
Loading
from mdengler:mtd-fix-np-bool-deprecation-21165

Conversation

@mdengler
Copy link

@mdengler mdengler commented Oct 25, 2023
edited
Loading

Description

(Complete-er version of PR #21223)

bool replaces np.bool, a deprecated alias for the builtin bool; fixes #21165

Bug symptom: Importing mxnet with numpy 1.20+ results in

AttributeError: module 'numpy' has no attribute 'bool'.
np.bool was a deprecated alias for the builtin bool. To avoid this error in existing code, use bool by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.bool_ here. The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

Checklist

Essentials

  • PR's title starts with a category (e.g. [BUGFIX], [MODEL], [TUTORIAL], [FEATURE], [DOC], etc)
  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage
  • Code is well-documented

Changes

  • bool replaces np.bool everywhere, since np.bool was an alias to bool anyway, and is no longer defined/bound

Comments

  • Backwards compatible (according to numpy error message, quoted above)

Copy link

Hey @mdengler , Thanks for submitting the PR
All tests are already queued to run once. If tests fail, you can trigger one or more tests again with the following commands:

  • To trigger all jobs: @mxnet-bot run ci [all]
  • To trigger specific jobs: @mxnet-bot run ci [job1, job2]

CI supported jobs: [miscellaneous, clang, unix-gpu, edge, windows-cpu, unix-cpu, sanity, website, centos-gpu, centos-cpu, windows-gpu]


Note:
Only following 3 categories can trigger CI :PR Author, MXNet Committer, Jenkins Admin.
All CI tests must pass before the PR can be merged.

Copy link

mimiao2017 commented Oct 25, 2023 via email

您好,您发给我的邮件已收到,我会尽快查看。

Copy link
Author

@mxnet-bot run ci all

Copy link

wmjim commented Nov 1, 2023

什么时候能解决呢

Copy link
Contributor

lgov commented Nov 5, 2023

@mdengler : patch looks good to me, thanks. This project was retired by the community, so there will be no new release anymore.
FYI: I'm using your patch to use the mxnet ImageRecordIter code in a PyTorch project for image classification, which is in my setup almost twice as fast as WebDataSet.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@szha szha Awaiting requested review from szha szha is a code owner

@aaronmarkham aaronmarkham Awaiting requested review from aaronmarkham aaronmarkham is a code owner

1 more reviewer

@cjolivier01 cjolivier01 cjolivier01 approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

MXNet does not support NumPy 1.24

AltStyle によって変換されたページ (->オリジナル) /