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

object_detection_birds - numpy depency issue #4560

Open
jacobscgc opened this issue Feb 7, 2024 · 0 comments
Open

object_detection_birds - numpy depency issue #4560

jacobscgc opened this issue Feb 7, 2024 · 0 comments

Comments

@jacobscgc
Copy link

Link to the notebook
https://github.com/aws/amazon-sagemaker-examples/blob/main/introduction_to_amazon_algorithms/object_detection_birds/object_detection_birds.ipynb

Describe the bug
In this notebook, it is using im2rec.py to create the RecordIO files. However, mxnet, used there, depends on an older version of numpy which is no longer supported. This leads to this error:

AttributeError: module 'numpy' has no attribute 'bool'

Change cell 1 from:

# These packages are needed to use OpenCV in Studio as of February 2022
! pip install distro
import distro
if "debian" in distro.linux_distribution()[0].lower():
    ! apt-get update
    ! apt-get install ffmpeg libsm6 libxext6  -y

To:

# These packages are needed to use OpenCV in Studio as of February 2022
! pip install distro
# We need to downgrade numpy because it otherwise interferes with mxnet, which is used in the im2rec.py script (generates model input):
!python -m pip install numpy==1.23.1
import distro
if "debian" in distro.name().lower():
    ! pip install --upgrade pip
    ! apt-get update
    ! apt-get install ffmpeg libsm6 libxext6  -y

Fixes the issue (and removes an error log on distro.linux_distribution).

To reproduce
Load the repo into Sagemaker running the Data Science 3.0 python3 kernel using ml.t3.medium.

Logs
If applicable, add logs to help explain your problem.
You may also attach an .ipynb file to this issue if it includes relevant logs or output.

ps. mxnet has been archived and therefore I do not expect any updates there.

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

1 participant