thaitc-hust / yolov9-tensorrt

Yolov9 TensorRT Inference Python backend
29 stars 5 forks source link

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

Closed Egorundel closed 6 months ago

Egorundel commented 8 months ago

@thaitc-hust Hello, can you tell me which versions of the libraries:

albumentations matplotlib numpy onnxruntime pandas scikit-image seaborn

do you have it installed?

I'm asking because I have a bug popping up related to numpy: Screenshot: Screenshot from 2024-02-27 07-44-52

cmd output:

python3 object_detector_trt_nms.py --weight weights/yolov9.trt --img_test /home/egorundel/Videos/image1.jpg
/home/egorundel/projects/pycuda/pycuda/compyte/dtypes.py:120: FutureWarning: In the future `np.bool` will be defined as the corresponding NumPy scalar.
  reg.get_or_register_dtype("bool", np.bool)
Traceback (most recent call last):
  File "object_detector_trt_nms.py", line 13, in <module>
    import pycuda.autoinit
  File "/home/egorundel/projects/pycuda/pycuda/autoinit.py", line 7, in <module>
    from pycuda.tools import make_default_context
  File "/home/egorundel/projects/pycuda/pycuda/tools.py", line 49, in <module>
    _fill_dtype_registry(respect_windows=True)
  File "/home/egorundel/projects/pycuda/pycuda/compyte/dtypes.py", line 221, in _fill_dtype_registry
    fill_registry_with_c_types(
  File "/home/egorundel/projects/pycuda/pycuda/compyte/dtypes.py", line 120, in fill_registry_with_c_types
    reg.get_or_register_dtype("bool", np.bool)
  File "/home/egorundel/venvs/yolov9/lib/python3.8/site-packages/numpy/__init__.py", line 305, in __getattr__
    raise AttributeError(__former_attrs__[attr])
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
thaitc-hust commented 8 months ago

@Egorundel my environment:

numpy==1.24.4
matplotlib==3.7.4
pandas==2.0.3
onnxruntime==1.16.3
seaborn==0.13.0
Egorundel commented 8 months ago

Hmm, that's weird... My numpy version is the same as yours, but there is a bug. 🤔

thaitc-hust commented 8 months ago

@Egorundel how do u install pycuda?

Egorundel commented 8 months ago

@thaitc-hust As you have indicated here: https://github.com/thaitc-hust/yolov9-tensorrt/blob/main/README.md#environment