Open3D-ML
Open3D-ML copied to clipboard
Update visualizer.py. Fix import when no GUI
Shield import when Open3D was not built with GUI.
Hi @ccoulombe if Open3D is not built with GUI, then the whole visualizer.py code will not work. You will just run into an error later. It's better to let the import statement catch the error earlier and give a more understandable error message.
Hi @ccoulombe if Open3D is not built with GUI, then the whole visualizer.py code will not work. You will just run into an error later. It's better to let the import statement catch the error earlier and give a more understandable error message.
If i want to plot bboxes of pointcloud using tensorborad on headless server. How to fix the problem? We need build Open3D with Open3D-ML using "-DENABLE_HEADLESS_RENDERING=ON", no GUI will be enabled. As you say, the Open3D is not built with GUI, then the whole visualizer.py code will not work.
@ssheorey I understand that the visualizer will not work if Open3D is not built with GUI support, and that's my point here : the import is not conditionnal
This import needs to be shielded and conditionnal to GUI support. In a case where Open3D does not have GUI support, the visualizer makes no sense to import as you have pointed out, hence it should not be imported.
Importing the visualizer no matter the case, make importing open3d fail.
Ahhh, you are using Open3D somewhere and it imports visualizer.py, but you don't need that functionality. You are actually not using visualizer.py itself. That makes more sense now. Please add this comment in the code to the check anbd we can merge.
# Allow Open3D import when visualizer is not built or used.