Skip to content
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”, 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

AttributeError: 'SpanMarkerConfig' object has no attribute 'label2id' #67

Open
jdb110 opened this issue Nov 7, 2024 · 0 comments
Open

Comments

@jdb110
Copy link

jdb110 commented Nov 7, 2024

traceback (most recent call last):
File "f:\Code\UIE.conda\Lib\site-packages\span_marker\configuration.py", line 114, in getattribute
return super().getattribute(key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "f:\Code\UIE.conda\Lib\site-packages\transformers\configuration_utils.py", line 205, in getattribute
return super().getattribute(key)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'SpanMarkerConfig' object has no attribute 'label2id'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "f:\Code\UIE\span.py", line 78, in
main()
File "f:\Code\UIE\span.py", line 68, in main
trainer.train()
File "f:\Code\UIE.conda\Lib\site-packages\transformers\trainer.py", line 2123, in train
return inner_training_loop(
^^^^^^^^^^^^^^^^^^^^
File "f:\Code\UIE.conda\Lib\site-packages\transformers\trainer.py", line 2548, in _inner_training_loop
self._maybe_log_save_evaluate(tr_loss, grad_norm, model, trial, epoch, ignore_keys_for_eval)
File "f:\Code\UIE.conda\Lib\site-packages\transformers\trainer.py", line 3007, in _maybe_log_save_evaluate
self._save_checkpoint(model, trial, metrics=metrics)
File "f:\Code\UIE.conda\Lib\site-packages\transformers\trainer.py", line 3097, in _save_checkpoint
self.save_model(output_dir, _internal_call=True)
File "f:\Code\UIE.conda\Lib\site-packages\transformers\trainer.py", line 3730, in save_model
self._save(output_dir)
File "f:\Code\UIE.conda\Lib\site-packages\transformers\trainer.py", line 3834, in _save
self.model.save_pretrained(
File "f:\Code\UIE.conda\Lib\site-packages\span_marker\modeling.py", line 585, in save_pretrained
super().save_pretrained(
File "f:\Code\UIE.conda\Lib\site-packages\transformers\modeling_utils.py", line 2815, in save_pretrained
misplaced_generation_parameters = model_to_save.config._get_non_default_generation_parameters()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "f:\Code\UIE.conda\Lib\site-packages\transformers\configuration_utils.py", line 1041, in _get_non_default_generation_parameters
default_config = self.class()
^^^^^^^^^^^^^^^^
File "f:\Code\UIE.conda\Lib\site-packages\span_marker\configuration.py", line 79, in init
if self.label2id and "O" not in self.label2id:
^^^^^^^^^^^^^
File "f:\Code\UIE.conda\Lib\site-packages\span_marker\configuration.py", line 117, in getattribute
return super().getattribute("encoder")[key]

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

1 participant