Skip to content

TypeError: FeatLabelPadCollator.collate: pad_value is not present. #38

@minhson-kaist

Description

@minhson-kaist

Hi,

I have a question. When I tried to reproduce the results of claf, I got the error. Here is the script:

python train.py --base_config korquad/docqa
Traceback (most recent call last):
  File "train.py", line 3, in <module>
    from claf.config import args
  File "/workspace/sean/trial/claf/claf/__init__.py", line 4, in <module>
    from claf.data.reader import *
  File "/workspace/sean/trial/claf/claf/data/reader/__init__.py", line 2, in <module>
    from claf.data.reader.seq_cls import SeqClsReader
  File "/workspace/sean/trial/claf/claf/data/reader/seq_cls.py", line 9, in <module>
    from claf.data.dataset.seq_cls import SeqClsDataset
  File "/workspace/sean/trial/claf/claf/data/dataset/__init__.py", line 2, in <module>
    from claf.data.dataset.squad import SQuADDataset
  File "/workspace/sean/trial/claf/claf/data/dataset/squad.py", line 6, in <module>
    from claf.data.collate import PadCollator
  File "/workspace/sean/trial/claf/claf/data/collate.py", line 63, in <module>
    class FeatLabelPadCollator(PadCollator):
  File "/workspace/sean/trial/claf/claf/data/collate.py", line 85, in FeatLabelPadCollator
    def collate(self, datas, apply_pad=True, apply_pad_labels=(), apply_pad_values=()):
  File "/opt/conda/envs/claf/lib/python3.6/site-packages/overrides/overrides.py", line 88, in overrides
    return _overrides(method, check_signature, check_at_runtime)
  File "/opt/conda/envs/claf/lib/python3.6/site-packages/overrides/overrides.py", line 114, in _overrides
    _validate_method(method, super_class, check_signature)
  File "/opt/conda/envs/claf/lib/python3.6/site-packages/overrides/overrides.py", line 135, in _validate_method
    ensure_signature_is_compatible(super_method, method, is_static)
  File "/opt/conda/envs/claf/lib/python3.6/site-packages/overrides/signature.py", line 95, in ensure_signature_is_compatible
    super_sig, sub_sig, super_type_hints, sub_type_hints, is_static, method_name
  File "/opt/conda/envs/claf/lib/python3.6/site-packages/overrides/signature.py", line 136, in ensure_all_kwargs_defined_in_sub
    raise TypeError(f"{method_name}: `{name}` is not present.")
TypeError: FeatLabelPadCollator.collate: `pad_value` is not present.

It seems to me that the function apply_pad_values at line:
pad_value = apply_pad_values[apply_pad_labels.index(data_name)] did not work.

Maybe I'm wrong here. Could you give me some suggestions to fix it?

Thanks,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions