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

RuntimeError: Error(s) in loading state_dict for DebertaV2ForMultipleChoice #923

Open
amd-vivekag opened this issue Feb 13, 2025 · 0 comments

Comments

@amd-vivekag
Copy link

Steps to reproduce:

python run.py -t <testname> -b llvm-cpu -d local-task -c x86_64-linux-gnu  --mode=cl-onnx-iree --cleanup=3 --get-metadata -v

Tests failing:

hf_fine-tuned-MoritzLaurer-deberta-v3-large-zeroshot-v2.0-arceasy

Should get following Error/Stacktrace:

Traceback (most recent call last):
  File "/home/vivekag/scratch/AIGShark/nodai/SharkTestSuite_vivekag/SHARK-TestSuite/alt_e2eshark/onnx_tests/helper_classes.py", line 110, in construct_model
    self.export_model()
  File "/home/vivekag/scratch/AIGShark/nodai/SharkTestSuite_vivekag/SHARK-TestSuite/alt_e2eshark/onnx_tests/models/hf_models.py", line 259, in export_model
    super().export_model("O1" if self.name in basic_opt else None)
  File "/home/vivekag/scratch/AIGShark/nodai/SharkTestSuite_vivekag/SHARK-TestSuite/alt_e2eshark/onnx_tests/helper_classes.py", line 78, in export_model
    main_export(
  File "/home/vivekag/scratch/AIGShark/nodai/SharkTestSuite_nightly/nightly.env/lib/python3.10/site-packages/optimum/exporters/onnx/__main__.py", line 305, in main_export
    model = TasksManager.get_model_from_task(
  File "/home/vivekag/scratch/AIGShark/nodai/SharkTestSuite_nightly/nightly.env/lib/python3.10/site-packages/optimum/exporters/tasks.py", line 2283, in get_model_from_task
    model = model_class.from_pretrained(model_name_or_path, **kwargs)
  File "/home/vivekag/scratch/AIGShark/nodai/SharkTestSuite_nightly/nightly.env/lib/python3.10/site-packages/transformers/models/auto/auto_factory.py", line 564, in from_pretrained
    return model_class.from_pretrained(
  File "/home/vivekag/scratch/AIGShark/nodai/SharkTestSuite_nightly/nightly.env/lib/python3.10/site-packages/transformers/modeling_utils.py", line 4245, in from_pretrained
    ) = cls._load_pretrained_model(
  File "/home/vivekag/scratch/AIGShark/nodai/SharkTestSuite_nightly/nightly.env/lib/python3.10/site-packages/transformers/modeling_utils.py", line 4873, in _load_pretrained_model
    raise RuntimeError(f"Error(s) in loading state_dict for {model.__class__.__name__}:\n\t{error_msg}")
RuntimeError: Error(s) in loading state_dict for DebertaV2ForMultipleChoice:
  size mismatch for classifier.weight: copying a param with shape torch.Size([2, 1024]) from checkpoint, the shape in current model is torch.Size([1, 1024]).
  size mismatch for classifier.bias: copying a param with shape torch.Size([2]) from checkpoint, the shape in current model is torch.Size([1]).
  You may consider adding `ignore_mismatched_sizes=True` in the model `from_pretrained` method.

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