nmhkahn / MemN2N-pytorch

Implementation of End-to-End Memory Network in PyTorch
106 stars 21 forks source link

Error, when runing train.py #1

Open lxtGH opened 6 years ago

lxtGH commented 6 years ago

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

nmhkahn commented 6 years ago

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.

lxtGH commented 6 years ago

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

lxtGH commented 6 years ago

@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