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

BlazeposeDepthai.py -3 throws GLFW Error #5

Closed
wb666greene opened this issue Apr 24, 2021 · 6 comments
Closed

BlazeposeDepthai.py -3 throws GLFW Error #5

wb666greene opened this issue Apr 24, 2021 · 6 comments

Comments

@wb666greene
Copy link

All the requirements seemed to have installed OK, and running the basic python3 BlazeposeDepthai.py appears to work, although my OAK-D is at present not mounted where I can get far enough away for a full length body picture (I'll need a USB3 extension cable), I do see some segments being tracked.

But running the python3 BlazeposeDepthai.py -3 I get this error:
~/depthai_blazepose-main$ python3 BlazeposeDepthai.py -3 896 anchors have been created [Open3D WARNING] GLFW Error: GLX: Failed to create context: BadValue (integer parameter out of range for operation) [Open3D WARNING] Failed to create window Traceback (most recent call last): File "BlazeposeDepthai.py", line 591, in <module> ht = BlazeposeDepthai(input_src=args.input, File "BlazeposeDepthai.py", line 165, in __init__ opt.background_color = np.asarray([0, 0, 0]) AttributeError: 'NoneType' object has no attribute 'background_color'
Suggestions?
I've zero experience with the open-3d python package. I'm running on Ubuntu 20.04 with all updates as of a few hours ago.

@geaxgx
Copy link
Owner

geaxgx commented Apr 24, 2021

Can you tell me the version of open3d you are using ?
python3 -c "import open3d ; print(open3d.__version__)"

@wb666greene
Copy link
Author

>>> import open3d
>>> open3d.__version__
'0.12.0'

@geaxgx
Copy link
Owner

geaxgx commented Apr 24, 2021

I have installed the same version as yours but can't reproduce the problem.
The error you get in line 165 means that self.vis3d.get_render_option() in line 164 returns None.
I wonder if you can reproduce the problem with a simpler pure open3d script.
Can you try to run the code below which draws a blue sphere on a black background ?

import open3d as o3d
import numpy as np

vis3d = o3d.visualization.Visualizer()
vis3d.create_window() 
opt = vis3d.get_render_option()
opt.background_color = np.asarray([0, 0, 0])
mesh_sphere = o3d.geometry.TriangleMesh.create_sphere(radius=1.0)
mesh_sphere.paint_uniform_color([0.1, 0.1, 0.7])
mesh_sphere.compute_vertex_normals()
vis3d.add_geometry(mesh_sphere)
while True:
    vis3d.poll_events()
    vis3d.update_renderer()

@wb666greene
Copy link
Author

Doing your simpler script line by line in an interactive window I get:

>>> vis3d.create_window()
[Open3D WARNING] GLFW Error: GLX: Failed to create context: BadValue (integer parameter out of range for operation)
[Open3D WARNING] Failed to create window
False
>>> opt = vis3d.get_render_option()
>>> opt.background_color = np.asarray([0, 0, 0])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'NoneType' object has no attribute 'background_color'

Maybe I'm missing something at the system level for GLX context. I'm really not familiar with GLFW/GLX but this system can use the OpenVINO GPU with the sample C++ code and net[i].setPreferableTarget(cv2.dnn.DNN_TARGET_OPENCL_FP16) in my code to do MobilenetSSD.v2_coco object detection.

@geaxgx
Copy link
Owner

geaxgx commented Apr 25, 2021

It is not a problem with Open3d. Like you, I am not familiar GLFW/GLX but it is probably a problem on your system. You said you have updated it recently. Have you rebooted after the update ? https://www.reddit.com/r/SolusProject/comments/cmjyxq/opengl_and_minecraft/
Otherwise, I suggest you to google "GLFW Error: GLX: Failed to create context: BadValue (integer parameter out of range for operation)". Hopefully it may give you some hints on solving the problem.

@wb666greene
Copy link
Author

I searched and seems it happens a lot, in a lot of different applications. When there was a solution, it was rebooting. The updates I installed forced a reboot, but this was before I ran your requirements.txt

So I did. Looks like Linux developers are getting Windows Envy with requiring reboots after installation. This is the first time a pip install has ever required a reboot for me. Might be good to add it to your instructions in the readme.

Got further, put up a window and said pipeline created then failed at line 604 ht.run(), looked like it may not have found the OAK-D camera, so I ran it without the --show3d option and it seemed to work. Closed it, and retried with --show3d and it seems to be working now.

Looks like the OAK-D initialization/startup code isn't 100% reliable yet.

Thanks for the help and for sharing this code. I will learn a lot about using my OAK-D from studying and modifying this code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants