MemN2N-pytorch icon indicating copy to clipboard operation
MemN2N-pytorch copied to clipboard

Error, when runing train.py

Open lxtGH opened this issue 8 years ago • 3 comments

Traceback (most recent call last): File "memn2n/train.py", line 2, in import trainer File "/home/lxt/pytorch/MemN2N-pytorch/memn2n/trainer.py", line 9, in from model import MemN2N File "/home/lxt/pytorch/MemN2N-pytorch/memn2n/model.py", line 85 a_hat = u[-1]@self.C[self.max_hops].weight.transpose(0, 1) ^ SyntaxError: invalid syntax

lxtGH avatar Dec 10 '17 07:12 lxtGH

Hi, Could you let me know your system setting? Mine is Python 3.6 and PyTorch 0.3 and checked it works well.

Perhaps, u[-1]@self.c ... could be a problem. @ symbol is introduced in Python 3.5, so it could be problem if your version is 2.7 or less.

nmhkahn avatar Dec 10 '17 10:12 nmhkahn

Hi, Thanks for your reply it is version problem, also must use pytorch 0.3

lxtGH avatar Dec 11 '17 01:12 lxtGH

@nmhkahn Hi ! Another question is that I found if i set only_supporting=true, I can get 100% accuracy on task2 however if I set false, the accuracy varied a lot according to different initialing weights

lxtGH avatar Dec 12 '17 15:12 lxtGH