allenai/specter

cannot import name 'import_submodules' from 'allennlp.common.util'

Horsmann opened this issue · 2 comments

I installed specter following the provided instructions but when I run the creation script with the provided demo command

python scripts/embed.py \
--ids data/sample.ids --metadata data/sample-metadata.json \
--model ./model.tar.gz \
--output-file output.jsonl \
--vocab-dir data/vocab/ \
--batch-size 16 \
--cuda-device -1

I get this error from the allennlp library. Do you have any suggestions how to fix that?

Traceback (most recent call last):
  File "specter/predict_command.py", line 20, in <module>
    from allennlp.common.util import lazy_groups_of, import_submodules
ImportError: cannot import name 'import_submodules' from 'allennlp.common.util' (/home/horsmann/miniconda3/envs/specter/lib/python3.7/site-packages/allennlp/common/util.py)

P.S.:
I am on Ubuntu

Could you double check the version of your allennlp and make sure that it is same version as the one in the requirement.txt?

yrrah commented

I had a similar error from previously installing allennlp 2.4.0 and that fixed it for me