rikdz / GraphWriter

Code for "Text Generation from Knowledge Graphs with Graph Transformers"
515 stars 90 forks source link

Getting error while training data #26

Open dheerajnuka opened 3 years ago

dheerajnuka commented 3 years ago

Hi Team,

I am getting error while executing train.py file

error:

Traceback (most recent call last): File "./train.py", line 128, in main(args) File "./train.py", line 113, in main train(m,o,ds,args) File "./train.py", line 28, in train for count,b in enumerate(train_iter): File "/opt/tljh/user/lib/python3.7/site-packages/torchtext/data/iterator.py", line 157, in iter yield Batch(minibatch, self.dataset, self.device) File "/opt/tljh/user/lib/python3.7/site-packages/torchtext/data/batch.py", line 27, in init self.input_fields = [k for k, v in dataset.fields.items() if File "/opt/tljh/user/lib/python3.7/site-packages/torchtext/data/batch.py", line 28, in v is not None and not v.is_target] AttributeError: 'RawField' object has no attribute 'is_target'

Please let me know if there is any solution for this.

Thanks, Dheeraj Nuka

rikdz commented 3 years ago

Hi Dheeraj, this code is built with an older torchtext, probably around v0.4 or earlier. Please modify as needed!