i’m getting this error why running BYTETracker in Google Collab.
AttributeError: module ‘numpy’ has no attribute ‘float’.
np.float
was a deprecated alias for the builtin float
. To avoid this error in existing code, use float
by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.float64
here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
NumPy 1.20.0 Release Notes — NumPy v2.1.dev0 Manual
Help me please…
solve the problem by downgrading the numpy to 1.22.4
opened 03:35AM - 27 Jun 23 UTC
closed 01:18PM - 04 Jul 23 UTC
bug
### Search before asking
- [X] I have searched the Roboflow Notebooks [issues](… https://github.com/roboflow-ai/notebooks/issues) and found no similar bug report.
### Notebook name
how-to-track-and-count-vehicles-with-yolov8.ipynb
### Bug
File "/opt/homebrew/anaconda3/envs/roboflow/lib/python3.10/site-packages/numpy/__init__.py", line 313, in __getattr__
raise AttributeError(__former_attrs__[attr])
AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` 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
### Environment
Python 3.10.12 | packaged by conda-forge
Macbook pro
pip install cython_bbox
Collecting cython_bbox
Using cached cython_bbox-0.1.3.tar.gz (41 kB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: cython_bbox
Building wheel for cython_bbox (setup.py) ... done
Created wheel for cython_bbox: filename=cython_bbox-0.1.3-cp310-cp310-macosx_11_0_arm64.whl size=17022 sha256=5655fbb95198577e3d5edef8fe8869aa15854a286bfb09c3c8a4ccd94e7c95ac
Stored in directory: /Users/thiruviji/Library/Caches/pip/wheels/33/f2/fc/4a4b0f3870075d64eb15a38c9ecb3c3d582677ee5f2f2e8939
Successfully built cython_bbox
Installing collected packages: cython_bbox
Successfully installed cython_bbox-0.1.3
>>> from yolox.tracker.byte_tracker import BYTETracker, STrack
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/thiruviji/Bi3/roboflow/ByteTrack/yolox/tracker/byte_tracker.py", line 10, in <module>
from yolox.tracker import matching
File "/Users/thiruviji/Bi3/roboflow/ByteTrack/yolox/tracker/matching.py", line 7, in <module>
from cython_bbox import bbox_overlaps as bbox_ious
File "src/cython_bbox.pyx", line 12, in init cython_bbox
File "/opt/homebrew/anaconda3/envs/roboflow/lib/python3.10/site-packages/numpy/__init__.py", line 313, in __getattr__
raise AttributeError(__former_attrs__[attr])
AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` 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
### Minimal Reproducible Example
thiruviji@Thiruvijis-MBP ByteTrack % python
Python 3.10.12 | packaged by conda-forge | (main, Jun 23 2023, 22:41:52) [Clang 15.0.7 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import yolox
>>> print("yolox.__version__:", yolox.__version__)
yolox.__version__: 0.1.0
>>> from yolox.tracker.byte_tracker import BYTETracker, STrack
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/thiruviji/Bi3/roboflow/ByteTrack/yolox/tracker/byte_tracker.py", line 10, in <module>
from yolox.tracker import matching
File "/Users/thiruviji/Bi3/roboflow/ByteTrack/yolox/tracker/matching.py", line 7, in <module>
from cython_bbox import bbox_overlaps as bbox_ious
File "src/cython_bbox.pyx", line 12, in init cython_bbox
File "/opt/homebrew/anaconda3/envs/roboflow/lib/python3.10/site-packages/numpy/__init__.py", line 313, in __getattr__
raise AttributeError(__former_attrs__[attr])
AttributeError: module 'numpy' has no attribute 'float'.
`np.float` was a deprecated alias for the builtin `float`. To avoid this error in existing code, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` 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
### Additional
_No response_
### Are you willing to submit a PR?
- [ ] Yes I'd like to help by submitting a PR!
leo
March 17, 2024, 4:14am
3
Awesome! Thank you for sharing your solution!
1 Like
system
Closed
March 24, 2024, 4:14am
4
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.