nuscenes-devkit
nuscenes-devkit copied to clipboard
Running render_scene in Jupyter notebook throws error
Hey,
I've found an issue related to render_scene function, running it in Jupyter notebook throws following error:
---------------------------------------------------------------------------
error Traceback (most recent call last)
<ipython-input-51-13531c073da2> in <module>
----> 1 level5data.render_scene(my_scene['token'])
/opt/conda/lib/python3.6/site-packages/lyft_dataset_sdk/lyftdataset.py in render_scene(self, scene_token, freq, imwidth, out_path)
507
508 def render_scene(self, scene_token: str, freq: float = 10, imwidth: int = 640, out_path: str = None) -> None:
--> 509 self.explorer.render_scene(scene_token, freq, image_width=imwidth, out_path=out_path)
510
511 def render_scene_channel(
/opt/conda/lib/python3.6/site-packages/lyft_dataset_sdk/lyftdataset.py in render_scene(self, scene_token, freq, image_width, out_path)
1154
1155 window_name = "{}".format(scene_rec["name"])
-> 1156 cv2.namedWindow(window_name)
1157 cv2.moveWindow(window_name, 0, 0)
1158
error: OpenCV(4.1.0) /io/opencv/modules/highgui/src/window.cpp:610: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvNamedWindow'
Running the same function in a python script works perfectly fine. Here's my Kaggle kernel which you can copy and rerun to produce the error: https://www.kaggle.com/rishabhiitbhu/eda-understanding-the-dataset
Could you please share an example on how to reproduce the bug?
Sure, suppose you have an instance of LyftDataset
let's call it lyftdata
my_scene = lyftdata.scene[0]
lyftdata.render_scene(my_scene['token'])
The second line throws the error. Note: The error only comes in a jupyter notebook. Not when it is run in a python script.