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: 'Wav2Vec2Config' object has no attribute 'problem_type' #2

Closed
245789064 opened this issue Jul 6, 2021 · 0 comments
Closed

Comments

@245789064
Copy link

Hi,can you help me with this problem.
thank u!


AttributeError Traceback (most recent call last)
in
----> 1 trainer.train()

~/anaconda3/lib/python3.7/site-packages/transformers/trainer.py in train(self, resume_from_checkpoint, trial, **kwargs)
1051 raise ValueError(f"Can't find a valid checkpoint at {resume_from_checkpoint}")
1052
-> 1053 logger.info(f"Loading model from {resume_from_checkpoint}).")
1054
1055 if os.path.isfile(os.path.join(resume_from_checkpoint, CONFIG_NAME)):

in training_step(self, model, inputs)
45 loss = self.compute_loss(model, inputs)
46 else:
---> 47 loss = self.compute_loss(model, inputs)
48
49 if self.args.gradient_accumulation_steps > 1:

~/anaconda3/lib/python3.7/site-packages/transformers/trainer.py in compute_loss(self, model, inputs, return_outputs)
1473 # Save model checkpoint
1474 checkpoint_folder = f"{PREFIX_CHECKPOINT_DIR}-{self.state.global_step}"
-> 1475
1476 if self.hp_search_backend is not None and trial is not None:
1477 if self.hp_search_backend == HPSearchBackend.OPTUNA:

~/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py in _call_impl(self, *input, **kwargs)
725 result = self._slow_forward(*input, **kwargs)
726 else:
--> 727 result = self.forward(*input, **kwargs)
728 for hook in itertools.chain(
729 _global_forward_hooks.values(),

in forward(self, input_values, attention_mask, output_attentions, output_hidden_states, return_dict, labels)
83 loss = None
84 if labels is not None:
---> 85 if self.config.problem_type is None:
86 if self.num_labels == 1:
87 self.config.problem_type = "regression"

AttributeError: 'Wav2Vec2Config' object has no attribute 'problem_type'

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