Closed agolo-alan-hogue closed 11 months ago
Hi!
More fun with GENRE!
I manually replaced np.float
with just float
, which happens only in fairseq
.
That gives another error. I'll paste that one below. So I went to the normal GENRE repo and found this note regarding fairseq
here:
fairseq>=0.10 (optional for training GENRE) NOTE: fairseq is going though changing without backward compatibility. Install fairseq from source and use [this](https://github.com/nicola-decao/fairseq/tree/fixing_prefix_allowed_tokens_fn) commit for reproducibilty. See https://github.com/pytorch/fairseq/pull/3276 for the current PR that should fix fairseq/master.
So it sounds to me like if you were to pull or rebase this PR maybe this would fix these problems?
Thanks for your help!
Latest error:
root@3e9ee535d1b0:/GENRE# python3 main.py --yago -i example_article.jsonl -o out.jsonl --split_iter --mention_trie data/mention_trie.pkl --mention_to_candidates_dict data/mention_to_candidates_dict.pkl
Traceback (most recent call last):
File "main.py", line 3, in <module>
from model import Model
File "/GENRE/model.py", line 6, in <module>
from genre.fairseq_model import GENRE
File "/GENRE/genre/fairseq_model.py", line 15, in <module>
from fairseq.models.bart import BARTHubInterface, BARTModel
File "/GENRE/fairseq/fairseq/models/__init__.py", line 208, in <module>
module = importlib.import_module("fairseq.models." + model_name)
File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/GENRE/fairseq/fairseq/models/wav2vec/__init__.py", line 6, in <module>
from .wav2vec import * # noqa
File "/GENRE/fairseq/fairseq/models/wav2vec/wav2vec.py", line 25, in <module>
from fairseq.tasks import FairseqTask
File "/GENRE/fairseq/fairseq/tasks/__init__.py", line 15, in <module>
from .fairseq_task import FairseqTask, LegacyFairseqTask # noqa
File "/GENRE/fairseq/fairseq/tasks/fairseq_task.py", line 13, in <module>
from fairseq import metrics, search, tokenizer, utils
ImportError: cannot import name 'metrics' from 'fairseq' (unknown location)
You set up GENRE from here, right? https://github.com/ad-freiburg/GENRE
If so, then could you please post the same issue in that repository? It was maintained by my colleague and I myself had nothing to do with setting it up and sadly don't know much about it.
There is no "Issues" tab in that repo, which I think means it is not turned on by the maintainer, so I thought that might mean they should be reported here. Do you think you could ask the maintainer to turn them on?
Oh I see, I didn't notice. I'll ask him about it!
It is now possible to open issues in the GENRE repository :)
Hello,
I got GENRE set up from your repo, but when I try to run it, I get this: