HekpoMaH / Neural-Bipartite-Matching

8 stars 7 forks source link

TypeError: argument of type 'int' is not iterable #2

Open balexx2 opened 1 year ago

HekpoMaH commented 1 year ago

I am unable to reproduce the issue with information provided. By following the instructions, I am able to run the demo notebook and I do not get the above error.

I would also advise that, apart from trying to solve the problem yourself, maybe read some good issues submitted to github. E.g. the above issue does not even mention the file the error comes from and is just a copy/pasta dump. Good sources of inspiration on how to write issues could be closed issues or ones that is currently being worked on, taken from highly maintained open source libraries, like PyG or PyTorch.

Lastly, while I do not want to discourage you and ruin your enthusiasm, I highly recommend you experiment with an easier project first. This project here is not entry-level and assumes familiarity with coding (and esp. coding GNNs). Good starting points could be Thomas Kipf's tutorial on GNNs (easy to find via Google) as well as Pytorch Geometric's tutorials.

balexx2 commented 1 year ago

Ok.Thank you

On Fri, Jul 7, 2023, 12:16 PM Dobrik Georgiev @.***> wrote:

I am unable to reproduce the issue with information provided. By following the instructions, I am able to run the demo notebook and I do not get the above error.

I would also advise that, apart from trying to solve the problem yourself, maybe read some good issues submitted to github. E.g. the above issue does not even mention the file the error comes from and is just a copy/pasta dump. Good sources of inspiration on how to write issues could be closed issues or ones that is currently being worked on, taken from highly maintained open source libraries, like PyG or PyTorch.

Lastly, while I do not want to discourage you and ruin your enthusiasm, I highly recommend you experiment with an easier project first. This project here is not entry-level and assumes familiarity with coding (and esp. coding GNNs). Good starting points could be Thomas Kipf's tutorial on GNNs (easy to find via Google) as well as Pytorch Geometric's tutorials.

— Reply to this email directly, view it on GitHub https://github.com/HekpoMaH/Neural-Bipartite-Matching/issues/2#issuecomment-1625112355, or unsubscribe https://github.com/notifications/unsubscribe-auth/A4D333GGEMXOLWTQQNTDEFLXO7HVRANCNFSM6AAAAAA2BQDTSQ . You are receiving this because you authored the thread.Message ID: @.***>

balexx2 commented 1 year ago

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 especially at 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