-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Error when using pyrealsense2 with multithreading #11129
Comments
Hi @NatanelBirarov The case at #946 may be a helpful reference for your problem of the program crashing after 15 frames. A workaround for the 15 frame issue can be to store frames in memory using the RealSense SDK's Keep() instruction, as described at #3164 (comment) and #3121 (comment) |
@MartyG-RealSense Thank you for the answer, I actually had a
I don't fully understand why, I guess it allows the program to get rid of the reference to the depth frame? not sure. I also don't know how it affects the runtime, but from the tests I made it didn't seem to affect it by much. |
You are very welcome, @NatanelBirarov - thanks very much for the update and for sharing your solution with the RealSense community! |
Hi @NatanelBirarov Do you require further assistance with this case, please? Thanks! |
Case closed due to no further comments received. |
Hello, I'm trying to write a simple program in Python, where the main thread will read depth frames from the camera and put them in a queue,
and another thread that will run inference on them with a YoloV5 TensorRT model. The program runs on a Jetson Nano.
For some reason, after reading about 15 frames the program crashes with the following error:
Here is the full code:
I tried commenting everything out and checking line by line, and I think the error is because of the
c.colorizer
taking too much time? When I deleted it the error went away (but of course the inference failed). If I don't remove it then the error appears after the lineimg = np.ascontiguousarray(img)
. But then why is the error not on this line?If I limit the size of the queue to at most 14, the problem stops, but then the queue is blocking so everything slows down. Also the error mentions a log, but I have no idea where it is.
Can anyone help me understand what I can do? Thank you in advance.
The text was updated successfully, but these errors were encountered: