rikdz / GraphWriter

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

Error in generator。py #40

Open hxy-123-coder opened 1 year ago

hxy-123-coder commented 1 year ago

when I run generator.py on colab, errors occurs. !python '/content/drive/MyDrive/Colab Notebooks/GraphWriter/generator.py' -save S /content/drive/MyDrive/Colab Notebooks/GraphWriter Loading Data from data/preprocessed.train.tsv building vocab done Vocab sizes: src 6343 ent 53343 nerd 8 rel 17 out 11738 graph Traceback (most recent call last): File "/content/drive/MyDrive/Colab Notebooks/GraphWriter/generator.py", line 71, in cpt = torch.load(args.save) File "/usr/local/lib/python3.8/dist-packages/torch/serialization.py", line 579, in load with _open_file_like(f, 'rb') as opened_file: File "/usr/local/lib/python3.8/dist-packages/torch/serialization.py", line 230, in _open_file_like return _open_file(name_or_buffer, mode) File "/usr/local/lib/python3.8/dist-packages/torch/serialization.py", line 211, in init super(_open_file, self).init(open(name, mode)) IsADirectoryError: [Errno 21] Is a directory: 'S'

rikdz commented 1 year ago

i think the -save flag is expecting a checkpoint file

hxy-123-coder commented 1 year ago

Thank u for your reply but there are still another errors when I run !python eval.py "/content/drive/MyDrive/Colab Notebooks/GraphWriter/outputs/0.vloss-4.068954.lr-0.1.inputs.beam_predictions.cmdline" "/content/drive/MyDrive/Colab Notebooks/GraphWriter/data/preprocessed.test.tsv"

Traceback (most recent call last): File "eval.py", line 93, in x.evaluate(live=True, cand=cands, ref=refs) File "eval.py", line 66, in evaluate final_scores = self.score(ref, hypo) File "eval.py", line 33, in score score, scores = scorer.compute_score(ref, hypo) File "/content/drive/MyDrive/Colab Notebooks/GraphWriter/pycocoevalcap/meteor/meteor.py", line 40, in compute_score self.meteor_p.stdin.write(score_line + '\n') BrokenPipeError: [Errno 32] Broken pipe