Having trouble running the "Getting started" section (even the tests do not run)
See original GitHub issueHi,
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
- Enter a clean anaconda docker container
docker run -it continuumio/anaconda3
apt-get update && apt install -y g++ make
git clone https://github.com/allenai/kb.git
conda create -n knowbert python=3.6.7
source activate knowbert
pip install torch==1.2.0
pip install -r requirements.txt
python -c "import nltk; nltk.download('wordnet')"
python -m spacy download en_core_web_sm
pip install --editable .
pytest -v tests
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
Tests not running in Test Explorer - visual studio
However, the tests are not running when using the Visual Studio test explorer. The Test Explorer is showing all unit tests, but once...
Read more >C# unit test tutorial - Visual Studio (Windows) - Microsoft Learn
If Test Explorer is not open, open it by choosing Test > Windows > Test Explorer from the top menu bar (or press...
Read more >Unit Testing Tutorial: 6 Best Practices to Get Up To Speed
3. Avoid Test Interdependence ... Each test should handle its own setup and tear down. The test runner will execute your stuff in...
Read more >Getting Started With Testing in Python
Running Your Tests From PyCharm If you're using the PyCharm IDE, you can run unittest or pytest by following these steps: In the...
Read more >Testing: Getting Started - The PHP Framework For Web Artisans
Tests within your "Unit" test directory do not boot your Laravel ... execute the vendor/bin/phpunit or php artisan test commands to run your...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Before running tests downgrading to overrides==3.1.0 and scikit-learn==0.22.2 solves the issue!
Thank you for your kindful help, I solved this problem by ‘pip install allennlp==0.8.2’ and other install instructions in https://github.com/allenai/kb/issues/39