allenai/sequential_sentence_classification

Error while running scripts/train.sh

Closed this issue · 2 comments

I am getting this error when trying to run the scripts/train.sh file

Traceback (most recent call last):
File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/content/sequential_sentence_classification/src/allennlp/allennlp/run.py", line 15, in
from allennlp.commands import main # pylint: disable=wrong-import-position
File "/content/sequential_sentence_classification/src/allennlp/allennlp/commands/init.py", line 8, in
from allennlp.commands.configure import Configure
File "/content/sequential_sentence_classification/src/allennlp/allennlp/commands/configure.py", line 26, in
from allennlp.service.config_explorer import make_app
File "/content/sequential_sentence_classification/src/allennlp/allennlp/service/config_explorer.py", line 24, in
from allennlp.common.configuration import configure, choices
File "/content/sequential_sentence_classification/src/allennlp/allennlp/common/configuration.py", line 17, in
from allennlp.data.dataset_readers import DatasetReader
File "/content/sequential_sentence_classification/src/allennlp/allennlp/data/init.py", line 1, in
from allennlp.data.dataset_readers.dataset_reader import DatasetReader
File "/content/sequential_sentence_classification/src/allennlp/allennlp/data/dataset_readers/init.py", line 10, in
from allennlp.data.dataset_readers.ccgbank import CcgBankDatasetReader
File "/content/sequential_sentence_classification/src/allennlp/allennlp/data/dataset_readers/ccgbank.py", line 9, in
from allennlp.data.dataset_readers.dataset_reader import DatasetReader
File "/content/sequential_sentence_classification/src/allennlp/allennlp/data/dataset_readers/dataset_reader.py", line 8, in
from allennlp.data.instance import Instance
File "/content/sequential_sentence_classification/src/allennlp/allennlp/data/instance.py", line 3, in
from allennlp.data.fields.field import DataArray, Field
File "/content/sequential_sentence_classification/src/allennlp/allennlp/data/fields/init.py", line 7, in
from allennlp.data.fields.array_field import ArrayField
File "/content/sequential_sentence_classification/src/allennlp/allennlp/data/fields/array_field.py", line 10, in
class ArrayField(Field[numpy.ndarray]):
File "/content/sequential_sentence_classification/src/allennlp/allennlp/data/fields/array_field.py", line 49, in ArrayField
@OVERRIDES
File "/usr/local/lib/python3.7/dist-packages/overrides/overrides.py", line 88, in overrides
return _overrides(method, check_signature, check_at_runtime)
File "/usr/local/lib/python3.7/dist-packages/overrides/overrides.py", line 114, in _overrides
_validate_method(method, super_class, check_signature)
File "/usr/local/lib/python3.7/dist-packages/overrides/overrides.py", line 135, in _validate_method
ensure_signature_is_compatible(super_method, method, is_static)
File "/usr/local/lib/python3.7/dist-packages/overrides/signature.py", line 93, in ensure_signature_is_compatible
ensure_return_type_compatibility(super_type_hints, sub_type_hints, method_name)
File "/usr/local/lib/python3.7/dist-packages/overrides/signature.py", line 288, in ensure_return_type_compatibility
f"{method_name}: return type {sub_return} is not a {super_return}."
TypeError: ArrayField.empty_field: return type None is not a <class 'allennlp.data.fields.field.Field'>.

This solved the issue for me: allenai/allennlp#5203 (comment)

This solved the issue for me: allenai/allennlp#5203 (comment)

It worked! Thanks for the help