mengmengliu1998 / LAformer

[CVPRW 2024]Official PyTorch Implementation of "LAformer: Trajectory Prediction for Autonomous Driving with Lane-Aware Scene Constraints"
Apache License 2.0
106 stars 13 forks source link

Questions about code #3

Closed Xu-Qingchao closed 10 months ago

Xu-Qingchao commented 10 months ago

Hello, thank you very much for your excellent work! In model_main.py

    def forward(self, mapping: List[Dict], device):
        vector_matrix = utils.get_from_mapping(mapping, 'matrix')
        for i in range(19):
            print(vector_matrix[i][0])
        # vectors of i_th element is matrix[polyline_spans[i]]
        polyline_spans = utils.get_from_mapping(mapping, 'polyline_spans')
        batch_size = len(vector_matrix)
        utils.batch_origin_init(mapping)

I want to print the vector of the first position of the intelligent agent. But I found that in some epoch, the x coordinate of the agent becomes negative. Such like this.

[ -0.07302541 -24.56219269  -0.07513113 -23.30788955   0.10382336
   0.           1.           0.           0.           1.
   0.           0.           0.           0.           0.
  -0.           0.           0.           0.           0.
   0.           0.           0.           0.           0.
   0.           0.           0.           0.          -0.
   0.          -0.        ]

It should have been like this.

[  0.07302541 -24.56219269   0.07513113 -23.30788955   0.10382336
   0.           1.           0.           0.           1.
   0.           0.           0.           0.           0.
   0.           0.           0.           0.           0.
   0.           0.           0.           0.           0.
   0.           0.           0.           0.           0.
   0.           0.        ]

I want to know if this is correct? What is the reason for this happening? thanks.

Harry333777 commented 10 months ago

Hello, thank you very much for your excellent work! In model_main.py

    def forward(self, mapping: List[Dict], device):
        vector_matrix = utils.get_from_mapping(mapping, 'matrix')
        for i in range(19):
            print(vector_matrix[i][0])
        # vectors of i_th element is matrix[polyline_spans[i]]
        polyline_spans = utils.get_from_mapping(mapping, 'polyline_spans')
        batch_size = len(vector_matrix)
        utils.batch_origin_init(mapping)

I want to print the vector of the first position of the intelligent agent. But I found that in some epoch, the x coordinate of the agent becomes negative. Such like this.

[ -0.07302541 -24.56219269  -0.07513113 -23.30788955   0.10382336
   0.           1.           0.           0.           1.
   0.           0.           0.           0.           0.
  -0.           0.           0.           0.           0.
   0.           0.           0.           0.           0.
   0.           0.           0.           0.          -0.
   0.          -0.        ]

It should have been like this.

[  0.07302541 -24.56219269   0.07513113 -23.30788955   0.10382336
   0.           1.           0.           0.           1.
   0.           0.           0.           0.           0.
   0.           0.           0.           0.           0.
   0.           0.           0.           0.           0.
   0.           0.           0.           0.           0.
   0.           0.        ]

I want to know if this is correct? What is the reason for this happening? thanks. Hello, I have been working on a reproduction of this article recently. Can you leave a personal address on your homepage for me to contact you?

Xu-Qingchao commented 10 months ago

@Harry333777 You can find email on my homepage.

mengmengliu1998 commented 10 months ago

Hi, I think this is the result of coordinate normalisation due to inaccurate yaw angles during data preprocessing. When you look at the argoverse trajectory data, you will see that in some cases the trajectory coordinates are very noisy.

Xu-Qingchao commented 10 months ago

thanks, When I print the yaw angles, each epoch is the same, but the x coordinate occasionally appears negative. I don't know where the code caused this coordinate normalization. Will this phenomenon affect the training results?

mengmengliu1998 commented 10 months ago

This phenomenon affects network learning because the network receives noisy training data. However, other models on the argoverse benchmark are trained with the same data, so it is fair for comparison with other models. https://github.com/mengmengliu1998/LAformer/blob/main/src/datascripts/dataset_argoverse.py#L408

Xu-Qingchao commented 10 months ago

Okay, I understand. Thank you very much!