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

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: #272

Closed
1 of 2 tasks
chinmayeebidaye opened this issue May 4, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@chinmayeebidaye
Copy link

Search before asking

  • I have searched the Roboflow Notebooks issues and found no similar bug report.

Notebook name

Track and Count Vehicles with YOLOv8 + ByteTRACK + Supervision

Bug

0: 384x640 1 person, 1 backpack, 3901.6ms
Speed: 6.2ms preprocess, 3901.6ms inference, 1.8ms postprocess per image at shape (1, 3, 384, 640)

AttributeError Traceback (most recent call last)
in <cell line: 22>()
31 )
32
---> 33 tracks = byte_tracker.update(
34 output_results=detections2boxes(detections=detections),
35 img_info=frame.shape,

3 frames
/content/ByteTrack/yolox/tracker/byte_tracker.py in update(self, output_results, img_info, img_size)
187 if len(dets):
188 '''Detections'''
--> 189 detections = [STrack(STrack.tlbr_to_tlwh(tlbr), s) for
190 (tlbr, s) in zip(dets, scores_keep)]
191 else:

/content/ByteTrack/yolox/tracker/byte_tracker.py in (.0)
187 if len(dets):
188 '''Detections'''
--> 189 detections = [STrack(STrack.tlbr_to_tlwh(tlbr), s) for
190 (tlbr, s) in zip(dets, scores_keep)]
191 else:

/content/ByteTrack/yolox/tracker/byte_tracker.py in init(self, tlwh, score)16
17 # wait activate
---> 18 self._tlwh = np.asarray(tlwh, dtype=float)
19 self.kalman_filter = None
20 self.mean, self.covariance = None, None

/usr/local/lib/python3.10/dist-packages/numpy/init.py in getattr(attr)
317
318 if attr in former_attrs:
--> 319 raise AttributeError(former_attrs[attr])
320
321 if attr == 'testing':

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.

Environment

-Google Colab

Minimal Reproducible Example

No response

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!
@chinmayeebidaye chinmayeebidaye added the bug Something isn't working label May 4, 2024
@iurisilvio
Copy link

The error comes from ifzhang/ByteTrack#386.

@chinmayeebidaye
Copy link
Author

I followed the steps but i'm still getting the same error. Any idea why?

@iurisilvio
Copy link

This notebook is outdated:

This notebook uses legacy versions of ByteTrack and Supervision. To be up to date, use our updated notebook.

I'd suggest you to run with the updated version.

I tried to build ByteTrack, but many packages are outdated now.

@SkalskiP
Copy link
Collaborator

SkalskiP commented May 6, 2024

Hi, @chinmayeebidaye! 👋🏻

Unfortunately, due to a conflict between the versions of NumPy in the Google Colab environment and the requirements set by ByteTrack, we cannot resolve this issue. However, as @iurisilvio recommended, I suggest using the revamped version of this Notebook, which should work without any problems.

@SkalskiP
Copy link
Collaborator

SkalskiP commented May 6, 2024

I'm closing this issue. Don't hesitate to ask if anything is unclear.

@SkalskiP SkalskiP closed this as completed May 6, 2024
@chinmayeebidaye
Copy link
Author

@SkalskiP ThankYou

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants