motional / nuplan-devkit

The devkit of the nuPlan dataset.
https://www.nuplan.org
Other
674 stars 129 forks source link

Error in running the tutorials: ModuleNotFoundError: No module named 'bokeh.plotting.figure' #194

Closed RobotLearner2022 closed 1 year ago

RobotLearner2022 commented 1 year ago

Describe the bug

While running the notebook tutorials, such as nuplan_scenario_visualization.ipynb, I met the error as follows: ModuleNotFoundError: No module named 'bokeh.plotting.figure'

I think this was caused by the changed API in bokeh (my installed version is 3.0.2). I manually replaced all the instances of "from bokeh.plotting.figure import Figure" in various python files to "from bokeh.plotting import figure" and replaced the class references from "Figure" to "figure". Then this error was not seen. It should be an easy fix at your side. Thank you!

Setup

I pulled the latest github version and used miniconda to set up the virtual environment correctly.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Run command jupyter notebook nuplan_scenario_visualization.ipynb
  2. Click to run the 3rd block: from bokeh.io import output_notebook from tutorials.utils.tutorial_utils import visualize_nuplan_scenarios output_notebook()
  3. See error

Stack Trace


ModuleNotFoundError                       Traceback (most recent call last)
Cell In [1], line 3
      1 from bokeh.io import output_notebook
----> 3 from tutorials.utils.tutorial_utils import visualize_nuplan_scenarios
      5 output_notebook()

File ~/work/external/nuplan-devkit/tutorials/utils/tutorial_utils.py:25
     23 from nuplan.planning.nuboard.base.data_class import NuBoardFile, SimulationScenarioKey
     24 from nuplan.planning.nuboard.base.experiment_file_data import ExperimentFileData
---> 25 from nuplan.planning.nuboard.base.simulation_tile import SimulationTile
     26 from nuplan.planning.scenario_builder.abstract_scenario import AbstractScenario
     27 from nuplan.planning.scenario_builder.nuplan_db.nuplan_scenario import NuPlanScenario

File ~/work/external/nuplan-devkit/nuplan/planning/nuboard/base/simulation_tile.py:20
     18 from bokeh.layouts import column, gridplot
     19 from bokeh.models import Button, ColumnDataSource, Slider, Title
---> 20 from bokeh.plotting.figure import Figure
     21 from selenium import webdriver
     22 from tornado import gen

ModuleNotFoundError: No module named 'bokeh.plotting.figure'
RobotLearner2022 commented 1 year ago

Sorry, I just noticed that there was an earlier bug on the same problem. Downgrading bokeh to 2.4.2 solved the problem. However, I hope the nuplan code can be updated too. Thank you!

patk-motional commented 1 year ago

Hi @RobotLearner2022,

Good to see that you found a fix for it. We will look to pin the version if possible.