AntNLP / gnn-dep-parsing

Apache License 2.0
32 stars 7 forks source link

Error when trying to run train.py #10

Closed raypretam closed 1 year ago

raypretam commented 1 year ago

Getting the following error when python train.py --config_file ../configs/default.cfg --name gnn --gpu 0

Traceback (most recent call last):
  File "train.py", line 2, in <module>
    from utils.conllu_reader import PTBReader
  File "/home/preetam_pg/gnn-dep-parsing/gnn-dep-parser/src/utils/conllu_reader.py", line 5, in <module>
    from antu.io.instance import Instance
  File "/home/preetam_pg/miniconda3/envs/gnn-dep/lib/python3.6/site-packages/antu/io/__init__.py", line 2, in <module>
    from .instance import Instance
  File "/home/preetam_pg/miniconda3/envs/gnn-dep/lib/python3.6/site-packages/antu/io/instance.py", line 4, in <module>
    from .fields import Field
  File "/home/preetam_pg/miniconda3/envs/gnn-dep/lib/python3.6/site-packages/antu/io/fields/__init__.py", line 2, in <module>
    from .index_field import IndexField
  File "/home/preetam_pg/miniconda3/envs/gnn-dep/lib/python3.6/site-packages/antu/io/fields/index_field.py", line 3, in <module>
    from ..token_indexers import TokenIndexer
  File "/home/preetam_pg/miniconda3/envs/gnn-dep/lib/python3.6/site-packages/antu/io/token_indexers/__init__.py", line 2, in <module>
    from .char_token_indexer import CharTokenIndexer
  File "/home/preetam_pg/miniconda3/envs/gnn-dep/lib/python3.6/site-packages/antu/io/token_indexers/char_token_indexer.py", line 8, in <module>
    class CharTokenIndexer(TokenIndexer):
  File "/home/preetam_pg/miniconda3/envs/gnn-dep/lib/python3.6/site-packages/antu/io/token_indexers/char_token_indexer.py", line 33, in CharTokenIndexer
    counters: Dict[str, Dict[str, int]]) -> None:
  File "/home/preetam_pg/miniconda3/envs/gnn-dep/lib/python3.6/site-packages/overrides/overrides.py", line 83, in overrides
    return _overrides(method, check_signature, check_at_runtime)
  File "/home/preetam_pg/miniconda3/envs/gnn-dep/lib/python3.6/site-packages/overrides/overrides.py", line 170, in _overrides
    _validate_method(method, super_class, check_signature)
  File "/home/preetam_pg/miniconda3/envs/gnn-dep/lib/python3.6/site-packages/overrides/overrides.py", line 189, in _validate_method
    ensure_signature_is_compatible(super_method, method, is_static)
  File "/home/preetam_pg/miniconda3/envs/gnn-dep/lib/python3.6/site-packages/overrides/signature.py", line 104, in ensure_signature_is_compatible
    super_sig, sub_sig, super_type_hints, sub_type_hints, is_static, method_name
  File "/home/preetam_pg/miniconda3/envs/gnn-dep/lib/python3.6/site-packages/overrides/signature.py", line 145, in ensure_all_kwargs_defined_in_sub
    raise TypeError(f"{method_name}: `{name}` is not present.")
TypeError: CharTokenIndexer.count_vocab_items: `counter` is not present. 

Environment Details : antu:0.0.5a0 dynet:2.1.2 python:3.6.13

Shanmathi2002 commented 1 year ago

I'm also getting the same error :( @raypretam were you able to solve this ? if so a little help would be so grateful. Thanks :)

raypretam commented 1 year ago

Check out the top two closed issues.

Shanmathi2002 commented 1 year ago

Could you be a little more specific, I don't know where to trace back this error by referring to the closed issues, also i don't know whether it is related to the dynet version or something else. Currently using dynet==2.1.2

Thanks in advance..!