NVlabs / traffic-behavior-simulation

Other
176 stars 26 forks source link

Key errors when running with nuScenes dataset #6

Closed purewater0901 closed 1 year ago

purewater0901 commented 1 year ago

Due to the change in the latest commit, I encountered the following errors. Is it okay to remove all_other_agents_curr_speed from the batch keys?

This is my error

Traceback (most recent call last):
  File "scripts/evaluate.py", line 428, in <module>
    run_evaluation(
  File "scripts/evaluate.py", line 147, in run_evaluation
    stats, info, renderings, adjust_plans, trace = rollout_episodes(
  File "/home/yutaka/nvidia_simulator/tbsim/tbsim/utils/env_utils.py", line 286, in rollout_episodes
    action = policy.get_action(obs_torch, step_index=counter)
  File "/home/yutaka/nvidia_simulator/tbsim/tbsim/policies/wrappers.py", line 282, in get_action
    agents_action, agents_action_info = self.agents_policy.get_action(
  File "/home/yutaka/nvidia_simulator/tbsim/tbsim/policies/wrappers.py", line 237, in get_action
    action, action_info = self.policy.get_action(obs, **kwargs)
  File "/home/yutaka/nvidia_simulator/tbsim/tbsim/policies/wrappers.py", line 178, in get_action
    return self.model.get_action(obs, **self.action_kwargs, **kwargs)
  File "/home/yutaka/nvidia_simulator/tbsim/tbsim/policies/wrappers.py", line 107, in get_action
    _, action_info = self.sampler.get_action(obs)
  File "/home/yutaka/nvidia_simulator/tbsim/tbsim/policies/wrappers.py", line 64, in get_action
    actions_tiled, _ = self.controller.get_action(
  File "/home/yutaka/nvidia_simulator/tbsim/tbsim/algos/multiagent_algos.py", line 134, in get_action
    preds = self.model.forward_prediction(feats_tiled, obs_tiled, plan=plan_tiled)
  File "/home/yutaka/nvidia_simulator/tbsim/tbsim/models/multiagent_models.py", line 334, in forward_prediction
    dyn_states = batch_utils().get_current_states_all_agents(
  File "/home/yutaka/nvidia_simulator/tbsim/tbsim/utils/batch_utils.py", line 265, in get_current_states_all_agents
    state_all = trajdataBatchUtils.batch_to_raw_all_agents(batch, step_time)
  File "/home/yutaka/nvidia_simulator/tbsim/tbsim/utils/batch_utils.py", line 209, in batch_to_raw_all_agents
    data_batch["all_other_agents_curr_speed"]
KeyError: 'all_other_agents_curr_speed'

image

chenyx09 commented 1 year ago

Hi Yutaka,

It seems that the key was removed by accident in the last commit. Is your problem solved after you add it back?

Best, Yuxiao

On Sun, Oct 8, 2023 at 8:53 PM Yutaka Shimizu @.***> wrote:

Due to the change in the latest commit, I encountered the following errors. Is it okay to remove all_other_agents_curr_speed from the batch keys?

This is my error

Traceback (most recent call last): File "scripts/evaluate.py", line 428, in run_evaluation( File "scripts/evaluate.py", line 147, in run_evaluation stats, info, renderings, adjust_plans, trace = rollout_episodes( File "/home/yutaka/nvidia_simulator/tbsim/tbsim/utils/env_utils.py", line 286, in rollout_episodes action = policy.get_action(obs_torch, step_index=counter) File "/home/yutaka/nvidia_simulator/tbsim/tbsim/policies/wrappers.py", line 282, in get_action agents_action, agents_action_info = self.agents_policy.get_action( File "/home/yutaka/nvidia_simulator/tbsim/tbsim/policies/wrappers.py", line 237, in get_action action, action_info = self.policy.get_action(obs, kwargs) File "/home/yutaka/nvidia_simulator/tbsim/tbsim/policies/wrappers.py", line 178, in get_action return self.model.get_action(obs, self.action_kwargs, **kwargs) File "/home/yutaka/nvidia_simulator/tbsim/tbsim/policies/wrappers.py", line 107, in getaction , action_info = self.sampler.get_action(obs) File "/home/yutaka/nvidia_simulator/tbsim/tbsim/policies/wrappers.py", line 64, in get_action actionstiled, = self.controller.get_action( File "/home/yutaka/nvidia_simulator/tbsim/tbsim/algos/multiagent_algos.py", line 134, in get_action preds = self.model.forward_prediction(feats_tiled, obs_tiled, plan=plan_tiled) File "/home/yutaka/nvidia_simulator/tbsim/tbsim/models/multiagent_models.py", line 334, in forward_prediction dyn_states = batch_utils().get_current_states_all_agents( File "/home/yutaka/nvidia_simulator/tbsim/tbsim/utils/batch_utils.py", line 265, in get_current_states_all_agents state_all = trajdataBatchUtils.batch_to_raw_all_agents(batch, step_time) File "/home/yutaka/nvidia_simulator/tbsim/tbsim/utils/batch_utils.py", line 209, in batch_to_raw_all_agents data_batch["all_other_agents_curr_speed"] KeyError: 'all_other_agents_curr_speed'

[image: image] https://user-images.githubusercontent.com/43805014/273494864-13809df7-1c3c-4d42-8345-d81f3e071d25.png

— Reply to this email directly, view it on GitHub https://github.com/NVlabs/traffic-behavior-simulation/issues/6, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC5LEZWRM563RDOWUYAAGUDX6NYNDAVCNFSM6AAAAAA5YFZGFWVHI2DSMVQWIX3LMV43ASLTON2WKOZRHEZTEMRVGY3TSNA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

purewater0901 commented 1 year ago

Hello Yuxiao

Yes, after I added it manually, it works without any issues.