LaneGCN_ref
LaneGCN_ref copied to clipboard
Bugs in hdmap.py
In https://github.com/zhaone/LaneGCN_ref/blob/main/data/LaneGCN/hdmap.py#L176
dist = np.expand_dims(ctrs, axis=1) - np.expand_dims(ctrs, axis=0)
dist = np.sqrt((dist ** 2).sum(2))
The motivation should be calculating a distance matrix of nodes which shape is $(M,M)$, where M is the number of nodes.
However, the code above will get a $(N,N,2)$ matrix, where N is the number of lanes.
Therefore, the index operation in #L199 left_dist[hi[mask], wi[mask]] = 1e6
will raise a out of range error.
Also, the same error happens in https://github.com/zhaone/LaneGCN_ref/blob/main/data/LaneGCN/hdmap.py#L208.
The feats should be a tensor with the shape of (num of nodes, 2). However the code miss np.concatenate(feats, 0)
.