XL2248 / HGNN

Code for Infusing Multi-Source Knowledge with Heterogeneous Graph Neural Network for Emotional Conversation Generation (AAAI21)
Apache License 2.0
25 stars 7 forks source link

"IndexError: column index (94) out of bounds" about generate_matrix_A4meld.py #3

Open scutcyr opened 3 years ago

scutcyr commented 3 years ago

When I try to run the code bash python generate_matrix_A4meld.py train it will report an error as shown in follow: bash Traceback (most recent call last): File "generate_matrix_A4meld.py", line 181, in <module> readFileRows(filepath) File "generate_matrix_A4meld.py", line 120, in readFileRows adj_matrix_speaker_text[j, 70+word2embed[speaker[j]]] = 1 File "D:\mysoftware\anaconda\envs\py36mmmtd\lib\site-packages\scipy\sparse\lil.py", line 325, in __setitem__ self.rows, self.data, i, j, x) File "_csparsetools.pyx", line 63, in scipy.sparse._csparsetools.lil_insert File "_csparsetools.pyx", line 89, in scipy.sparse._csparsetools.lil_insert IndexError: column index (94) out of bounds the scipy version is 1.2.0 and 1.5.4 Therefore, I strongly recommend that authors can specify the version of some key dependency packages(e.g. scipy), through the file requirements.txt.

Thanks!

scutcyr commented 3 years ago

By default, the speakers.txt generated by the python generate_speakers4meld.py has 30 speakers. Therefore, the 70+word2embed[speaker[j]] would cause the IndexError: column index (94) out of bounds, because 70+30>90! Thus, all the 70+word2embed[speaker[j]] need to be adjusted to 60+word2embed[speaker[j]], 'i+35' need to be adjusted to 'i+30' and 'j+35' need to be adjusted to 'j+30'.

In other words, the 70/35 here is not fixed, it needs to be adjusted according to the number of speakers. Unfortunately, the author did not point out this detail in the README.md file.

XL2248 commented 3 years ago

When I try to run the code bash python generate_matrix_A4meld.py train it will report an error as shown in follow: bash Traceback (most recent call last): File "generate_matrix_A4meld.py", line 181, in <module> readFileRows(filepath) File "generate_matrix_A4meld.py", line 120, in readFileRows adj_matrix_speaker_text[j, 70+word2embed[speaker[j]]] = 1 File "D:\mysoftware\anaconda\envs\py36mmmtd\lib\site-packages\scipy\sparse\lil.py", line 325, in __setitem__ self.rows, self.data, i, j, x) File "_csparsetools.pyx", line 63, in scipy.sparse._csparsetools.lil_insert File "_csparsetools.pyx", line 89, in scipy.sparse._csparsetools.lil_insert IndexError: column index (94) out of bounds the scipy version is 1.2.0 and 1.5.4 Therefore, I strongly recommend that authors can specify the version of some key dependency packages(e.g. scipy), through the file requirements.txt.

Thanks!

Thanks for pointing this, and I will update them later.

XL2248 commented 3 years ago

By default, the speakers.txt generated by the python generate_speakers4meld.py has 30 speakers. Therefore, the 70+word2embed[speaker[j]] would cause the IndexError: column index (94) out of bounds, because 70+30>90! Thus, all the 70+word2embed[speaker[j]] need to be adjusted to 60+word2embed[speaker[j]], 'i+35' need to be adjusted to 'i+30' and 'j+35' need to be adjusted to 'j+30'.

In other words, the 70/35 here is not fixed, it needs to be adjusted according to the number of speakers. Unfortunately, the author did not point out this detail in the README.md file.

Thanks for pointing out this and I will update this soon.

yuan-ning commented 3 years ago

When I try to run the code: python generate_matrix_A4meld.py train it will report an error as shown in follow: Traceback (most recent call last): File "generate_matrix_A4meld.py", line 181, in readFileRows(filepath) File "generate_matrix_A4meld.py", line 57, in readFileRows with open('speakers1.txt', 'r') as fopen: FileNotFoundError: [Errno 2] No such file or directory: 'speakers1.txt'

i can't find 'speakers1.txt',maybe it need be generated by some other process?

yuan-ning commented 3 years ago

By default, the speakers.txt generated by the python generate_speakers4meld.py has 30 speakers. Therefore, the 70+word2embed[speaker[j]] would cause the IndexError: column index (94) out of bounds, because 70+30>90! Thus, all the 70+word2embed[speaker[j]] need to be adjusted to 60+word2embed[speaker[j]], 'i+35' need to be adjusted to 'i+30' and 'j+35' need to be adjusted to 'j+30'.

In other words, the 70/35 here is not fixed, it needs to be adjusted according to the number of speakers. Unfortunately, the author did not point out this detail in the README.md file. Could you please tell me if you have passed this project