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

ValueError: zero-size array to reduction operation maximum which has no identity #23

Open
beizhengren opened this issue Dec 10, 2024 · 2 comments

Comments

@beizhengren
Copy link

Thanks for the sharing.

When I run the simulation command as
sh ./script/run_pluto_planner.sh pluto_planner nuplan_mini mini_demo_scenario last.ckpt new_output
the following error occurs:
ValueError: zero-size array to reduction operation maximum which has no identity

The detail of the error:

----------- Simulation failed: with the following trace:
Sequential:   0%|                                                                                             | 0/1 [00:47<?, ?it/s]Traceback (most recent call last):
  File "/home/wyz/workspace/learning/planing/nuplan-devkit/nuplan/planning/simulation/runner/executor.py", line 27, in run_simulation
    return sim_runner.run()
  File "/home/wyz/workspace/learning/planing/nuplan-devkit/nuplan/planning/simulation/runner/simulations_runner.py", line 113, in run
    trajectory = self.planner.compute_trajectory(planner_input)
  File "/home/wyz/workspace/learning/planing/nuplan-devkit/nuplan/planning/simulation/planner/abstract_planner.py", line 108, in compute_trajectory
    raise e
  File "/home/wyz/workspace/learning/planing/nuplan-devkit/nuplan/planning/simulation/planner/abstract_planner.py", line 105, in compute_trajectory
    trajectory = self.compute_planner_trajectory(current_input)
  File "/home/wyz/workspace/learning/planing/pluto/src/planners/pluto_planner.py", line 166, in compute_planner_trajectory
    planning_trajectory = self._run_planning_once(current_input)
  File "/home/wyz/workspace/learning/planing/pluto/src/planners/pluto_planner.py", line 200, in _run_planning_once
    candidate_trajectories, learning_based_score = self._trim_candidates(
  File "/home/wyz/workspace/learning/planing/pluto/src/planners/pluto_planner.py", line 286, in _trim_candidates
    sorted_probability = softmax(sorted_probability)
  File "/home/wyz/anaconda3/envs/pluto/lib/python3.9/site-packages/scipy/special/_logsumexp.py", line 232, in softmax
    x_max = np.amax(x, axis=axis, keepdims=True)
  File "/home/wyz/anaconda3/envs/pluto/lib/python3.9/site-packages/numpy/core/fromnumeric.py", line 2827, in amax
    return _wrapreduction(a, np.maximum, 'max', axis, None, out,
  File "/home/wyz/anaconda3/envs/pluto/lib/python3.9/site-packages/numpy/core/fromnumeric.py", line 88, in _wrapreduction
    return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
ValueError: zero-size array to reduction operation maximum which has no identity
2024-12-10 22:03:06,974 WARNING {/home/wyz/workspace/learning/planing/nuplan-devkit/nuplan/planning/simulation/runner/executor.py:34}  Simulation failed with error:
 zero-size array to reduction operation maximum which has no identity
2024-12-10 22:03:06,974 WARNING {/home/wyz/workspace/learning/planing/nuplan-devkit/nuplan/planning/simulation/runner/executor.py:38}  
Failed simulation [log,token]:
 [2021.08.17.16.57.11_veh-08_01200_01636, 9e30155b8bb55fd9]

Here is my local dir
image
What is causing this problem, and how should it be resolved?
Thanks all.

@zachytong
Copy link

looks like the sorted_probability array passed to the softmax function is empty. This could happen if the _trim_candidates method in pluto_planner.py is not generating any candidate trajectories or if the array is being filtered incorrectly. maybe you should check sorted_probability before softmax it and find ways to handle it.

@Tobias-lt
Copy link

I also have the same problem, may I ask that have you solved the problem? And could you please let me know how to solve it? Thanks.

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

3 participants