HekpoMaH/Neural-Bipartite-Matching

IndexError: index 6 is out of bounds for dimension 0 with size 6

balexx2 opened this issue · 0 comments

Hello Prof, I embarked on understanding Nueral bipartite matching as
clearly explained in your paper. i have tested 98% of your code and its a
success. i have only met the error: IndexError: index 6 is out of bounds
for dimension 0 with size 6
and it points to utils.py script.iam testing on different new graph data.The error is in this function:::::
def create_inv_edge_index(batch_size, size, edge_index):iei =
torch.full((batch_sizesize, batch_sizesize), -100, dtype=torch.long)for i
in range(len(edge_index[0])):iei[edge_index[0][i]][edge_index[1][i]] =
ireturn iei

part of the output where the error is displayed is shown below:
tedge_index = torch.tensor(edge_index).clone().detach()
tensor([[ 5., 1.],
[ 1., 1.],
[14., 1.],
[ 7., 1.],
[ 1., 1.],
[ 6., 1.],
[12., 1.],
[14., 1.],
[15., 1.],
[ 5., 1.],
[10., 1.],
[ 2., 0.],
[ 9., 0.],
[14., 0.],
[15., 0.],
[13., 0.],
[ 5., 0.],
[ 3., 0.],
[10., 0.],
[ 9., 0.],
[15., 0.],
[14., 0.]], grad_fn=)
ROOT ./bfs_less_wired
PROCESSED bfs_less_wired/processed
ROOT ./bfs_less_wired
PROCESSED bfs_less_wired/processed
ROOT ./all_iter_less_wired
PRP []
PROCESSED all_iter_less_wired/processed
ROOT ./all_iter_less_wired
PRP []
PROCESSED all_iter_less_wired/processed
Processing...
Done!
Processing...
Done!
Processing...
Done!
Processing...
Done!
Traceback (most recent call last):

File "/tmp/ipykernel_5044/3463109613.py", line 73, in
inv_edge_index = utils.create_inv_edge_index(len(GRAPH_SIZES),
GRAPH_SIZES.max(), batch.edge_index)

File "/home/nahondo/Desktop/nsm/utils.py", line 221, in
create_inv_edge_index
iei[edge_index[0][i]][edge_index[1][i]] = i

IndexError: index 6 is out of bounds for dimension 0 with size 6