8000 Having trouble running the "Getting started" section (even the tests do not run) · Issue #35 · allenai/kb · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Having trouble running the "Getting started" section (even the tests do not run) #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub&rd 8000 quo;, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
devfoo-one opened this issue Jun 25, 2021 · 5 comments

Comments

@devfoo-one
Copy link

Hi,

I am trying to run the KnowBert code but keep getting stuck with the following error when trying to run the tests or the "How to embed sentences or sentence pairs programmatically" snippet:

tests/evaluation/test_wic_reader.py:3: in <module>
    from kb.include_all import  WicDatasetReader
kb/include_all.py:2: in <module>
    from kb.kg_embedding import KGTupleReader, KGTupleModel
kb/kg_embedding.py:8: in <module>
    from allennlp.data import DatasetReader, Token, Vocabulary
/opt/conda/envs/knowbert/lib/python3.6/site-packages/allennlp/data/__init__.py:1: in <module>
    from allennlp.data.dataset_readers.dataset_reader import DatasetReader
/opt/conda/envs/knowbert/lib/python3.6/site-packages/allennlp/data/dataset_readers/__init__.py:10: in <module>
    from allennlp.data.dataset_readers.ccgbank import CcgBankDatasetReader
/opt/conda/envs/knowbert/lib/python3.6/site-packages/allennlp/data/dataset_readers/ccgbank.py:9: in <module>
    from allennlp.data.dataset_readers.dataset_reader import DatasetReader
/opt/conda/envs/knowbert/lib/python3.6/site-packages/allennlp/data/dataset_readers/dataset_reader.py:4: in <module>
    from allennlp.data.instance import Instance
/opt/conda/envs/knowbert/lib/python3.6/site-packages/allennlp/data/instance.py:4: in <module>
    from allennlp.data.fields import TextField, ListField, SpanField
/opt/conda/envs/knowbert/lib/python3.6/site-packages/allennlp/data/fields/__init__.py:7: in <module>
    from allennlp.data.fields.array_field import ArrayField
/opt/conda/envs/knowbert/lib/python3.6/site-packages/allennlp/data/fields/array_field.py:10: in <module>
    class ArrayField(Field[numpy.ndarray]):
/opt/conda/envs/knowbert/lib/python3.6/site-packages/allennlp/data/fields/array_field.py:45: in ArrayField
    @overrides
/opt/conda/envs/knowbert/lib/python3.6/site-packages/overrides/overrides.py:88: in overrides
    return _overrides(method, check_signature, check_at_runtime)
/opt/conda/envs/knowbert/lib/python3.6/site-packages/overrides/overrides.py:114: in _overrides
    _validate_method(method, super_class, check_signature)
/opt/conda/envs/knowbert/lib/python3.6/site-packages/overrides/overrides.py:135: in _validate_method
    ensure_signature_is_compatible(super_method, method, is_static)
/opt/conda/envs/knowbert/lib/python3.6/site-packages/overrides/signature.py:93: in ensure_signature_is_compatible
    ensure_return_type_compatibility(super_type_hints, sub_type_hints, method_name)
/opt/conda/envs/knowbert/lib/python3.6/site-packages/overrides/signature.py:288: in ensure_return_type_compatibility
    f"{method_name}: return type `{sub_return}` is not a `{super_return}`."
E   TypeError: ArrayField.empty_field: return type `None` is not a `allennlp.data.fields.field.Field`.

Steps to reproduce

  1. Enter a clean anaconda docker container docker run -it continuumio/anaconda3
  2. apt-get update && apt install -y g++ make
  3. git clone https://github.com/allenai/kb.git
  4. conda create -n knowbert python=3.6.7
  5. source activate knowbert
  6. pip install torch==1.2.0
  7. pip install -r requirements.txt
  8. python -c "import nltk; nltk.download('wordnet')"
  9. python -m spacy download en_core_web_sm
  10. pip install --editable .
  11. pytest -v tests
@lunarie16
Copy link

Before running tests downgrading to overrides==3.1.0 and scikit-learn==0.22.2 solves the issue!

@devfoo-one
Copy link
Author

@lunarie16 Thanks! I´ve changed my requirements to

torch==1.4.0
Flask
waitress
ujson
spacy==2.0.18
urllib3==1.25.10
click==7.1.2
overrides==3.1.0
scikit-learn==0.22.2

and it works as expected.

@leonodelee
Copy link

Hello, have you installed the allennlp? I can't install it with the official guide

@gpiat
Copy link
gpiat commented Jun 3, 2022

@leonodelee Hello, have you tried following the steps I give in my answers to issue #39 ? If so and you still have trouble, please provide error messages, or if there are none, a more detailed description of the abnormal behavior.

@leonodelee
Copy link

@leonodelee Hello, have you tried following the steps I give in my answers to issue #39 ? If so and you still have trouble, please provide error messages, or if there are none, a more detailed description of the abnormal behavior.

Thank you for your kindful help, I solved this problem by 'pip install allennlp==0.8.2' and other install instructions in #39

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
0