Specformer icon indicating copy to clipboard operation
Specformer copied to clipboard

The problem of the logits'shape in the train_epoch function in the dgl_main.py

Open fantasy-zc opened this issue 10 months ago • 1 comments

Hi, i am very excited for your work, so i am running your codes. there is a problem for me in the train_epoch function in the dgl_main.py. Actually, in the train_epoch, there is a parameter named as "logits", the computation of logits as follow logits = model(e, u, g, length) so logits'type is tuple, so there will be a error such as "'tuple' object has no attribute 'to'". Now i solve this problem by chatgpt #chatgpt if isinstance(logits, tuple): logits = logits[0] #chatgpt # Adjust logits and y shapes if necessary logits = logits.squeeze(dim=-1) # 去除多余的维度 By adding these codes, the program can run. However, logits is a tuple, the codelogits = logits[0] just gains the first element of logits, is this ture? I will be happy for your reply! Best wishes!

fantasy-zc avatar Mar 14 '25 03:03 fantasy-zc

I think so!

Lukangkang123 avatar Jun 19 '25 08:06 Lukangkang123