roboflow / notebooks

Examples and tutorials on using SOTA computer vision models and techniques. Learn everything from old-school ResNet, through YOLO and object-detection transformers like DETR, to the latest models like Grounding DINO and SAM.
https://roboflow.com/models
4.89k stars 759 forks source link

ByteTrack - cython_bbox - Numpy issue #156

Closed thirups closed 1 year ago

thirups commented 1 year ago

Search before asking

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 "", line 1, in File "/Users/thiruviji/Bi3/roboflow/ByteTrack/yolox/tracker/byte_tracker.py", line 10, in from yolox.tracker import matching File "/Users/thiruviji/Bi3/roboflow/ByteTrack/yolox/tracker/matching.py", line 7, in 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 "", line 1, in File "/Users/thiruviji/Bi3/roboflow/ByteTrack/yolox/tracker/byte_tracker.py", line 10, in from yolox.tracker import matching File "/Users/thiruviji/Bi3/roboflow/ByteTrack/yolox/tracker/matching.py", line 7, in 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?

github-actions[bot] commented 1 year ago

👋 Hello @thirups, thank you for leaving an issue on Roboflow Notebooks.

🐞 Bug reports

If you are filing a bug report, please be as detailed as possible. This will help us more easily diagnose and resolve the problem you are facing. To learn more about contributing, check out our Contributing Guidelines.

If you require support with custom code that is not part of Roboflow Notebooks, please reach out on the Roboflow Forum or on the GitHub Discussions page associated with this repository.

💬 Get in touch

Do you have more questions about Roboflow that we haven't responded to yet? Feel free to ask them on the Roboflow Discuss forum. Our developer advocates and community team actively respond to questions there.

To ask questions about Notebooks, head over to the GitHub Discussions section of this repository.

SkalskiP commented 1 year ago

Hi, @thirups 👋🏻 ! It looks like you installed numpy version. My guess is you should downgrade to a version below 1.20.

alifsyr commented 1 year ago

Hi, @SkalskiP , i want to downgrade my installed numpy version to 1.19.5. but i got this error

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for numpy Failed to build numpy ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects

can you help me? Environment Python 3.10.11 | OS: Ubuntu 20.04.6 LTS

SkalskiP commented 1 year ago

@alifsyr, how did you do it?

alifsyr commented 1 year ago

@SkalskiP it's already solve mate, i used version 1.22.4 and it works on ubuntu 20.04

SkalskiP commented 1 year ago

Awesome! 🔥 I'm closing the issue.

Denis-666 commented 11 months ago

Numpy ==1.22.4 , it help me a lot thx!!!!!!

SkalskiP commented 11 months ago

btw, we recently added ByteTrack support to Supervision. It is super easy to install and works just like the original ByteTrack. Take a look at the docs.

princeGedeon commented 11 months ago

Even with numpy ==1.22.4, me i have this error "head.py:27: UserWarning: Failed to initialize NumPy: module compiled against API version 0x10 but this version of numpy is 0xf . Check the section C-API incompatibility at the Troubleshooting ImportError section at https://numpy.org/devdocs/user/troubleshooting-importerror.html#c-api-incompatibility for indications on how to solve this problem . (Triggered internally at ..\torch\csrc\utils\tensor_numpy.cpp:84.) anchors = torch.empty(0) # init"