ai-winter/python_motion_planning

Error

Closed this issue · 2 comments

While I am running the local_example.py, the error comes out like:

C:\Users\28597.conda\envs\DDPG\python.exe F:/python_motion_planning-master/examples/local_example.py
Traceback (most recent call last):
File "F:\python_motion_planning-master\examples\local_example.py", line 21, in
planner = control_factory("ddpg", start=start, goal=goal, env=env)
File "F:\python_motion_planning-master\python_motion_planning\utils\planner\control_factory.py", line 27, in call
return DDPG(actor_load_path="models/actor_best_example.pth",
File "F:\python_motion_planning-master\python_motion_planning\local_planner\ddpg.py", line 245, in init
super().init(start, goal, env, heuristic_type, **params)
File "F:\python_motion_planning-master\python_motion_planning\local_planner\local_planner.py", line 35, in init
self.plot = Plot(start, goal, env)
File "F:\python_motion_planning-master\python_motion_planning\utils\plot\plot.py", line 18, in init
self.fig = plt.figure("planning")
File "C:\Users\28597.conda\envs\DDPG\lib\site-packages\matplotlib\pyplot.py", line 1027, in figure
manager = new_figure_manager(
File "C:\Users\28597.conda\envs\DDPG\lib\site-packages\matplotlib\pyplot.py", line 549, in new_figure_manager
_warn_if_gui_out_of_main_thread()
File "C:\Users\28597.conda\envs\DDPG\lib\site-packages\matplotlib\pyplot.py", line 526, in _warn_if_gui_out_of_main_thread
canvas_class = cast(type[FigureCanvasBase], _get_backend_mod().FigureCanvas)
File "C:\Users\28597.conda\envs\DDPG\lib\site-packages\matplotlib\pyplot.py", line 358, in _get_backend_mod
switch_backend(rcParams._get("backend"))
File "C:\Users\28597.conda\envs\DDPG\lib\site-packages\matplotlib\pyplot.py", line 416, in switch_backend
canvas_class = module.FigureCanvas
AttributeError: module 'backend_interagg' has no attribute 'FigureCanvas'. Did you mean: 'FigureCanvasAgg'?
Exception ignored in: <function DDPG.del at 0x000001DBC35FBF40>
Traceback (most recent call last):
File "F:\python_motion_planning-master\python_motion_planning\local_planner\ddpg.py", line 308, in del
self.writer.close()
AttributeError: 'DDPG' object has no attribute 'writer'

Process finished with exit code 1

I don't know how to deal with it. I have already created an new envs and installed depends. But it comes out. It looks like there's something wrong with the program.

Try examples written in DDPG class of python_motion_planning/local_planner/ddpg.py (line 216 to 230).

Thank you very much. Now the algorithm works.