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

Classification from webcam #9111

Closed
1 of 2 tasks
sctrueew opened this issue Aug 23, 2022 · 1 comment · Fixed by #9112
Closed
1 of 2 tasks

Classification from webcam #9111

sctrueew opened this issue Aug 23, 2022 · 1 comment · Fixed by #9112
Labels
bug Something isn't working

Comments

@sctrueew
Copy link

sctrueew commented Aug 23, 2022

Search before asking

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

YOLOv5 Component

No response

Bug

Hi,

I tested classify with a webcam and I got an error on this line:

im = im.to(device)

'numpy.ndarray' object has no attribute 'to'
I changed it to
im = torch.from_numpy(im).to(device)
works fine

Environment

No response

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!
@sctrueew sctrueew added the bug Something isn't working label Aug 23, 2022
glenn-jocher added a commit that referenced this issue Aug 23, 2022
Resolves #9111

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
glenn-jocher added a commit that referenced this issue Aug 23, 2022
* Fix numpy to torch cls streaming bug

Resolves #9111

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@glenn-jocher
Copy link
Member

@sctrueew good news 😃! Your original issue may now be fixed ✅ in PR #9112. To receive this update:

  • Gitgit pull from within your yolov5/ directory or git clone https://github.com/ultralytics/yolov5 again
  • PyTorch Hub – Force-reload model = torch.hub.load('ultralytics/yolov5', 'yolov5s', force_reload=True)
  • Notebooks – View updated notebooks Open In Colab Open In Kaggle
  • Dockersudo docker pull ultralytics/yolov5:latest to update your image Docker Pulls

Thank you for spotting this issue and informing us of the problem. Please let us know if this update resolves the issue for you, and feel free to inform us of any other issues you discover or feature requests that come to mind. Happy trainings with YOLOv5 🚀!

ctjanuhowski pushed a commit to ctjanuhowski/yolov5 that referenced this issue Sep 8, 2022
* Fix numpy to torch cls streaming bug

Resolves ultralytics#9111

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
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

Successfully merging a pull request may close this issue.

2 participants