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

ImportError: cannot import name 'bool' from 'numpy' (/home/cvit/miniconda3/envs/hybrik2/lib/python3.9/site-packages/numpy/__init__.py) #184

Closed
AmoghTiwari opened this issue Jul 19, 2023 · 1 comment

Comments

@AmoghTiwari
Copy link

After setup, on running

python scripts/demo_video.py --video-name examples/dance.mp4 --out-dir res_dance --save-pk --save-img, I get the below error

  warnings.warn(
/home/cvit/miniconda3/envs/hybrik2/lib/python3.9/site-packages/torchvision/models/_utils.py:223: UserWarning: Arguments other than a weight enum or `None` for 'weights' are deprecated since 0.13 and may be removed in the future. The current behavior is equivalent to passing `weights=FasterRCNN_ResNet50_FPN_Weights.COCO_V1`. You can also use `weights=FasterRCNN_ResNet50_FPN_Weights.DEFAULT` to get the most up-to-date weights.
  warnings.warn(msg)
/home/cvit/miniconda3/envs/hybrik2/lib/python3.9/site-packages/chumpy/__init__.py:11: FutureWarning: In the future `np.bool` will be defined as the corresponding NumPy scalar.
  from numpy import bool, int, float, complex, object, unicode, str, nan, inf
/home/cvit/miniconda3/envs/hybrik2/lib/python3.9/site-packages/chumpy/__init__.py:11: FutureWarning: In the future `np.object` will be defined as the corresponding NumPy scalar.
  from numpy import bool, int, float, complex, object, unicode, str, nan, inf
/home/cvit/miniconda3/envs/hybrik2/lib/python3.9/site-packages/chumpy/__init__.py:11: FutureWarning: In the future `np.str` will be defined as the corresponding NumPy scalar.
  from numpy import bool, int, float, complex, object, unicode, str, nan, inf
Traceback (most recent call last):
  File "/home/cvit/amogh/projects/HybrIK/scripts/demo_video.py", line 137, in <module>
    hybrik_model = builder.build_sppe(cfg.MODEL)
  File "/home/cvit/amogh/projects/HybrIK/hybrik/models/builder.py", line 21, in build_sppe
    return build(cfg, SPPE)
  File "/home/cvit/amogh/projects/HybrIK/hybrik/models/builder.py", line 17, in build
    return build_from_cfg(cfg, registry, default_args)
  File "/home/cvit/amogh/projects/HybrIK/hybrik/utils/registry.py", line 75, in build_from_cfg
    return obj_cls(**args)
  File "/home/cvit/amogh/projects/HybrIK/hybrik/models/HRNetWithCam.py", line 78, in __init__
    self.smpl = SMPL_layer(
  File "/home/cvit/amogh/projects/HybrIK/hybrik/models/layers/smpl/SMPL.py", line 85, in __init__
    self.smpl_data = Struct(**pk.load(smpl_file, encoding='latin1'))
  File "/home/cvit/miniconda3/envs/hybrik2/lib/python3.9/site-packages/chumpy/__init__.py", line 11, in <module>
    from numpy import bool, int, float, complex, object, unicode, str, nan, inf
ImportError: cannot import name 'bool' from 'numpy' (/home/cvit/miniconda3/envs/hybrik2/lib/python3.9/site-packages/numpy/__init__.py)```
@AmoghTiwari
Copy link
Author

This error comes due to numpy versioning. I was able to solve it by doing the following

  1. pip uninstall numpy
  2. pip install numpy==1.23.1

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