MCZhi / DIPP

[TNNLS] Differentiable Integrated Prediction and Planning Framework for Urban Autonomous Driving
https://mczhi.github.io/DIPP/
197 stars 40 forks source link

Variable Tensor Size from agent2agent Network Causes Index Out of Bounds Error #31

Open zywangEcho opened 2 weeks ago

zywangEcho commented 2 weeks ago

Hi, First of all, thank you for your excellent work on this project. I am currently working with the predictor.py file and have a question regarding the input data for the predictor model. Specifically,an error occurs when running the predictor due to the agent2agent network utilizing a mask, which results in a variable output tensor size. This leads to an index out of bounds error during subsequent iterations. “”“ Traceback (most recent call last): File "closed_loop_test.py", line 146, in closed_loop_test() File "closed_loop_test.py", line 66, in closed_loop_test plans, predictions, scores, cost_function_weights = predictor(ego, neighbors, lanes, crosswalks) File "/home/wzy/anaconda3/envs/DIPP/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl return forward_call(*args, **kwargs) File "/home/wzy/DIPP/model/predictor.py", line 243, in forward output = self.agent_map(agent_agent[:, i], lane_feature[:, i], crosswalk_feature[:, i], map_mask[:, i]) IndexError: index 8 is out of bounds for dimension 1 with size 8 ”“” I find that this error happened because "actor_mask". It make the tensor "agent_agent" has different size. In my testing, "actor_mask" first 8 positions are False, and the last 3 positions are True. So "agent_agent" size is [batch,8,256]. When it run to this segment: ''' for i in range(actors.shape[1]): output = self.agent_map(agent_agent[:, i], lane_feature[:, i], crosswalk_feature[:, i], map_mask[:, i]) map_feature.append(output[0]) agent_map.append(output[1]) ''' Because of different size between actors and agent_agent , it make mistake! How can I do to solve this problom? Thank you very much for your assistance.

MCZhi commented 2 weeks ago

Hi, @zywangEcho, thank you for your interest. For your question, please refer to #29 and #24.

zywangEcho commented 2 weeks ago

Thank you!