opendr-eu / opendr

A modular, open and non-proprietary toolkit for core robotic functionalities by harnessing deep learning
Apache License 2.0
611 stars 94 forks source link

Minor fix on yolov5 webcam demo #466

Closed tsampazk closed 10 months ago

tsampazk commented 10 months ago

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 commented 10 months ago

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 commented 10 months ago

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 commented 10 months ago

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 commented 10 months ago

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