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

Minor fix on yolov5 webcam demo #466

Merged
merged 6 commits into from
Sep 26, 2023
Merged

Minor fix on yolov5 webcam demo #466

merged 6 commits into from
Sep 26, 2023

Conversation

tsampazk
Copy link
Collaborator

When running yolov5 webcam demo, i ran into this error:

RuntimeError: cuDNN error: CUDNN_STATUS_NOT_INITIALIZED

when running infer.

This is fixed by importing torch (even though it is not directly used) which seems to initialize it properly, similar to inference demo which works fine.

This issue seems to originate from the latest gpu installation of the toolkit as described in #463.

@tsampazk tsampazk added the bug Something isn't working label Sep 25, 2023
@tsampazk tsampazk self-assigned this Sep 25, 2023
@tsampazk tsampazk added test sources Run style checks test tools Test the toolkit methods labels Sep 25, 2023
omichel
omichel previously approved these changes Sep 25, 2023
Copy link
Collaborator

@omichel omichel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.

@tsampazk
Copy link
Collaborator Author

Hmm it seems that our tests ignore # NOQA. As far as i can tell this originates from pyflakes which doesn't seem to support noqa. I will look into some dummy usage of torch as a workaround.

@omichel
Copy link
Collaborator

omichel commented Sep 25, 2023

Do we really want to print this message to the console? I believe we could implement a more silent dummy usage, e.g., assign this version value to a dummy variable instead of printing it in the console. Also, it would be nice to add a comment here to explain why we need this dummy assignment.

@tsampazk
Copy link
Collaborator Author

Do we really want to print this message to the console? I believe we could implement a more silent dummy usage, e.g., assign this version value to a dummy variable instead of printing it in the console. Also, it would be nice to add a comment here to explain why we need this dummy assignment.

Yeah, i think that assigning and not using will still fail the pep8 tests for variable assigned but not used. On the other hand silencing print is too much trouble because one would need to manipulate stdout. I entirely removed print which didn't fail the pyflakes test locally (my IDE still complains), let's see if the CI is ok with it.

@tsampazk
Copy link
Collaborator Author

It seems it passed the sources tests fine 😄. Sorry for the extra trouble Olivier.

Copy link
Collaborator

@omichel omichel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem. That's fine.
Good to see it passed the tests.

Copy link
Collaborator

@passalis passalis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@tsampazk tsampazk merged commit f4ff8b1 into develop Sep 26, 2023
48 checks passed
@tsampazk tsampazk deleted the fix-yolov5-webcam-demo branch September 26, 2023 06:43
lucamarchionni pushed a commit to lucamarchionni/opendr that referenced this pull request Jun 10, 2024
* Importing torch on yolov5 webcam demo to fix cuDNN error

* Re-attempting noqa

* Dummy usage of torch to avoid unused pep8 error

* Removed print from dummy usage and added comment

---------

Co-authored-by: Olivier Michel <Olivier.Michel@cyberbotics.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 test sources Run style checks test tools Test the toolkit methods
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants