Open lhy1214 opened 1 year ago
You may try to change this line to "concept_emb = con_nodes_features[concept_mask.long()]" I think "[concept_mask].type(torch.long)" should be "[concept_mask.type(torch.long)]" I hope the above solution works.
That's great! I have solved the previous problem according to the method you said, and then faced the following problem, I very much hope you can help me solve the following again.
Traceback (most recent call last):
File "D:\TERA\new\TREA-main\run_publish.py", line 1088, in
Try to transform the labels to long type: recloss = self.criterion2(entity_scores.unsqueeze(1).repeat(1, 32, 1).view(-1, entity_scores.shape[1]), ent_rec.view(-1).long())
Thank you very much, according to your help I have solved, I wish you all the best in your future work, thank you again.
Hello, I like this work very much, I encountered the following problem when reproducing, tried the solution, still reported the error, I want to ask you if there is a better solution. The error is in this line: concept_emb = con_nodes_features[concept_mask] IndexError: tensors used as indices must be long, byte or bool tensors I changed this line to : concept_emb = con_nodes_features[concept_mask].type(torch.long) The mistake is still the same mistake.I really need everyone's help, thank you very much.