Open EmilyCodeSailor opened 8 months ago
I found the syntax information file for Twitter 2015 in the Baidu Netdisk link you provided (link: https://pan.baidu.com/s/1WtmKmuJyI-MGgcaUQ9UYIQ, extraction code: xbpg). Could you please additionally provide the syntax information file for Twitter 2017? If I could receive your response, I would be honored. Thank you. 在您提供的百度网盘链接link: https://pan.baidu.com/s/1WtmKmuJyI-MGgcaUQ9UYIQ extraction code: xbpg中我找到了twitter2015的语法信息文件,可否能增加提供twitter2017的语法信息文件,如果能得到您的回复,我将不胜荣幸。 May I ask the code did you debug it successfully? I encountered some problems in the process of debugging the code and would like to ask you about it, I will be grateful if you reply!
I found the syntax information file for Twitter 2015 in the Baidu Netdisk link you provided (link: https://pan.baidu.com/s/1WtmKmuJyI-MGgcaUQ9UYIQ, extraction code: xbpg). Could you please additionally provide the syntax information file for Twitter 2017? If I could receive your response, I would be honored. Thank you. 在您提供的百度网盘链接link: https://pan.baidu.com/s/1WtmKmuJyI-MGgcaUQ9UYIQ extraction code: xbpg中我找到了twitter2015的语法信息文件,可否能增加提供twitter2017的语法信息文件,如果能得到您的回复,我将不胜荣幸。 May I ask the code did you debug it successfully? I encountered some problems in the process of debugging the code and would like to ask you about it, I will be grateful if you reply!
you can describe the problem you encountered.
I found the syntax information file for Twitter 2015 in the Baidu Netdisk link you provided (link: https://pan.baidu.com/s/1WtmKmuJyI-MGgcaUQ9UYIQ, extraction code: xbpg). Could you please additionally provide the syntax information file for Twitter 2017? If I could receive your response, I would be honored. Thank you. 在您提供的百度网盘链接link: https://pan.baidu.com/s/1WtmKmuJyI-MGgcaUQ9UYIQ extraction code: xbpg中我找到了twitter2015的语法信息文件,可否能增加提供twitter2017的语法信息文件,如果能得到您的回复,我将不胜荣幸。 May I ask the code did you debug it successfully? I encountered some problems in the process of debugging the code and would like to ask you about it, I will be grateful if you reply!
you can describe the problem you encountered.
For the code, I only modified the file path, and nothing else, but the following error appeared when I ran it, can you help me answer it, I will be grateful!
Traceback (most recent call last):
File "F:\Code\DPFN-main\train.py", line 314, in :
), ellipsis (...
), numpy.newaxis (None
) and integer or boolean arrays are valid indices
For the code, I only modified the file path, and nothing else, but the following error appeared when I ran it, can you help me answer it, I will be grateful! Traceback (most recent call last): File "F:\Code\DPFN-main\train.py", line 314, in main() File "F:\Code\DPFN-main\train.py", line 310, in main ins.run() File "F:\Code\DPFN-main\train.py", line 209, in run train_acc, train_loss = self.train_epoch(loss_fn, optimizer, scheduler) File "F:\Code\DPFN-main\train.py", line 111, in train_epoch inputs = [sample_batched[col].to(self.opt.device) for col in self.opt.inputs_cols] File "F:\Code\DPFN-main\train.py", line 111, in inputs = [sample_batched[col].to(self.opt.device) for col in self.opt.inputs_cols] IndexError: only integers, slices (
:
), ellipsis (...
), numpy.newaxis (None
) and integer or boolean arrays are valid indices
sample_batched是一个字典,self.opt.inputs_cols是包含sample_batched字典中的所有的键的列表,有['input_ids', 'attention_mask', 'vit_feature', 'transformer_mask', 'target_input_ids', 'target_attention_mask', 'target_mask', 'text_length', 'word_length', 'tran_indices', 'context_asp_adj_matrix', 'globel_input_id', 'globel_mask']。请在这句代码inputs = [sample_batched[col].to(self.opt.device) for col in self.opt.inputs_cols]之前检查sample_batched字典的内容,确保其中没有出现self.opt.inputs_cols未包含的键。 sample_batched is a dictionary, and self.opt.inputs_cols is a list containing all the keys from the sample_batched dictionary, such as ['input_ids', 'attention_mask', 'vit_feature', 'transformer_mask', 'target_input_ids', 'target_attention_mask', 'target_mask', 'text_length', 'word_length', 'tran_indices', 'context_asp_adj_matrix', 'globel_input_id', 'globel_mask']. Please check the contents of the sample_batched dictionary before the line of code inputs = [sample_batched[col].to(self.opt.device) for col in self.opt.inputs_cols], ensuring that it does not contain any keys not included in self.opt.inputs_cols.
For the code, I only modified the file path, and nothing else, but the following error appeared when I ran it, can you help me answer it, I will be grateful! Traceback (most recent call last): File "F:\Code\DPFN-main\train.py", line 314, in main() File "F:\Code\DPFN-main\train.py", line 310, in main ins.run() File "F:\Code\DPFN-main\train.py", line 209, in run train_acc, train_loss = self.train_epoch(loss_fn, optimizer, scheduler) File "F:\Code\DPFN-main\train.py", line 111, in train_epoch inputs = [sample_batched[col].to(self.opt.device) for col in self.opt.inputs_cols] File "F:\Code\DPFN-main\train.py", line 111, in inputs = [sample_batched[col].to(self.opt.device) for col in self.opt.inputs_cols] IndexError: only integers, slices (
:
), ellipsis (...
), numpy.newaxis (None
) and integer or boolean arrays are valid indicessample_batched是一个字典,self.opt.inputs_cols是包含sample_batched字典中的所有的键的列表,有['input_ids', 'attention_mask', 'vit_feature', 'transformer_mask', 'target_input_ids', 'target_attention_mask', 'target_mask', 'text_length', 'word_length', 'tran_indices', 'context_asp_adj_matrix', 'globel_input_id', 'globel_mask']。请在这句代码inputs = [sample_batched[col].to(self.opt.device) for col in self.opt.inputs_cols]之前检查sample_batched字典的内容,确保其中没有出现self.opt.inputs_cols未包含的键。 sample_batched is a dictionary, and self.opt.inputs_cols is a list containing all the keys from the sample_batched dictionary, such as ['input_ids', 'attention_mask', 'vit_feature', 'transformer_mask', 'target_input_ids', 'target_attention_mask', 'target_mask', 'text_length', 'word_length', 'tran_indices', 'context_asp_adj_matrix', 'globel_input_id', 'globel_mask']. Please check the contents of the sample_batched dictionary before the line of code inputs = [sample_batched[col].to(self.opt.device) for col in self.opt.inputs_cols], ensuring that it does not contain any keys not included in self.opt.inputs_cols.
请问您在运行代码的时候遇到这个问题了吗?我对代码没有改动,为什么会出现这个问题呀,self.opt. inputs_col是13列,而sample_batched是一个10*10的矩阵,我不知道该怎么改,非常感谢您的解答!
请问您在运行代码的时候遇到这个问题了吗?我对代码没有改动,为什么会出现这个问题呀,self.opt. inputs_col是13列,而sample_batched是一个10*10的矩阵,我不知道该怎么改,非常感谢您的解答!
你可以看一下sample_batched的生成过程,我没遇到过这个问题,所以我也不知道咋改。
请问您在运行代码的时候遇到这个问题了吗?我对代码没有改动,为什么会出现这个问题呀,self.opt. inputs_col是13列,而sample_batched是一个10*10的矩阵,我不知道该怎么改,非常感谢您的解答!
你可以看一下sample_batched的生成过程,我没遇到过这个问题,所以我也不知道咋改。
class Instructor: def init(self, opt): self.opt = opt if opt.dataset == "twitter15": train_data_name = 'middleFile/twitter15_train_datas.pkl' val_data_name = 'middleFile/twitter15_val_datas.pkl' test_data_name = 'middleFile/twitter15_test_datas.pkl' else: train_data_name = 'middleFile/twitter17_train_datas.pkl' val_data_name = 'middleFile/twitter17_val_datas.pkl' test_data_name = 'middleFile/twitter17_test_datas.pkl' 请问train.py代码中的这个文件路径是不是就是作者在data文件夹下oriAdj里面的三个文件,运行的时候把名字改了一下呀?您运行成功了是吧,真的非常感谢您对一个素未谋面的陌生人耐心地解答!
请问您在运行代码的时候遇到这个问题了吗?我对代码没有改动,为什么会出现这个问题呀,self.opt. inputs_col是13列,而sample_batched是一个10*10的矩阵,我不知道该怎么改,非常感谢您的解答!
你可以看一下sample_batched的生成过程,我没遇到过这个问题,所以我也不知道咋改。
class Instructor: def init(self, opt): self.opt = opt if opt.dataset == "twitter15": train_data_name = 'middleFile/twitter15_train_datas.pkl' val_data_name = 'middleFile/twitter15_val_datas.pkl' test_data_name = 'middleFile/twitter15_test_datas.pkl' else: train_data_name = 'middleFile/twitter17_train_datas.pkl' val_data_name = 'middleFile/twitter17_val_datas.pkl' test_data_name = 'middleFile/twitter17_test_datas.pkl' 请问train.py代码中的这个文件路径是不是就是作者在data文件夹下oriAdj里面的三个文件,运行的时候把名字改了一下呀?您运行成功了是吧,真的非常感谢您对一个素未谋面的陌生人耐心地解答!
不是,这是运行代码后生成的文件,不用改。我运行成功了,但是oriAdj中的三个文件中是针对twitter2015的,我暂时没有成功按照作者的提示去生成2017的语法数据文件,所以我暂时放弃了这个模型。
class Instructor: def init(self, opt): self.opt = opt if opt.dataset == "twitter15": train_data_name = 'middleFile/twitter15_train_datas.pkl' val_data_name = 'middleFile/twitter15_val_datas.pkl' test_data_name = 'middleFile/twitter15_test_datas.pkl' else: train_data_name = 'middleFile/twitter17_train_datas.pkl' val_data_name = 'middleFile/twitter17_val_datas.pkl' test_data_name = 'middleFile/twitter17_test_datas.pkl' 请问train.py代码中的这个文件路径是不是就是作者在data文件夹下oriAdj里面的三个文件,运行的时候把名字改了一下呀?您运行成功了是吧,真的非常感谢您对一个素未谋面的陌生人耐心地解答!
后续有其他问题可以通过QQ:1827312374联系我。
I found the syntax information file for Twitter 2015 in the Baidu Netdisk link you provided (link: https://pan.baidu.com/s/1WtmKmuJyI-MGgcaUQ9UYIQ, extraction code: xbpg). Could you please additionally provide the syntax information file for Twitter 2017? If I could receive your response, I would be honored. Thank you. 在您提供的百度网盘链接link: https://pan.baidu.com/s/1WtmKmuJyI-MGgcaUQ9UYIQ extraction code: xbpg中我找到了twitter2015的语法信息文件,可否能增加提供twitter2017的语法信息文件,如果能得到您的回复,我将不胜荣幸。