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

AutoModelForObjectDetection isnt working due to wrong output size #36464

Closed
4 tasks
nikitabelooussovbtis opened this issue Feb 27, 2025 · 4 comments · Fixed by #36463
Closed
4 tasks

AutoModelForObjectDetection isnt working due to wrong output size #36464

nikitabelooussovbtis opened this issue Feb 27, 2025 · 4 comments · Fixed by #36463
Labels

Comments

@nikitabelooussovbtis
Copy link

System Info

new:

  • transformers version: 4.50.0.dev0
  • Platform: Linux-6.11.0-17-generic-x86_64-with-glibc2.39
  • Python version: 3.12.3
  • Huggingface_hub version: 0.29.1
  • Safetensors version: 0.5.3
  • Accelerate version: 1.4.0
  • Accelerate config: not found
  • DeepSpeed version: not installed
  • PyTorch version (GPU?): 2.6.0+cu124 (False)
  • Tensorflow version (GPU?): not installed (NA)
  • Flax version (CPU?/GPU?/TPU?): not installed (NA)
  • Jax version: not installed
  • JaxLib version: not installed
  • Using distributed or parallel set-up in script?:

old:

  • transformers version: 4.50.0.dev0
  • Platform: Linux-6.11.0-17-generic-x86_64-with-glibc2.39
  • Python version: 3.12.3
  • Huggingface_hub version: 0.29.0
  • Safetensors version: 0.5.2
  • Accelerate version: 1.4.0
  • Accelerate config: not found
  • DeepSpeed version: not installed
  • PyTorch version (GPU?): 2.6.0+cu124 (False)
  • Tensorflow version (GPU?): not installed (NA)
  • Flax version (CPU?/GPU?/TPU?): not installed (NA)
  • Jax version: not installed
  • JaxLib version: not installed
  • Using distributed or parallel set-up in script?:

Who can help?

No response

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • My own task or dataset (give details below)

Reproduction

I was using the repisotry 2 days ago and it was working fine. With the new updates something has changed and now when I try to load a model it is telling me that the output size is incorrect: size mismatch for class_labels_classifier.weight: copying a param with shape torch.Size([92, 256]) from checkpoint, the shape in current model is torch.Size([11, 256]). The ignore_mismatched_sizes has been set to true and I am using the facebook/detr-resnet-50 model specefically. I am pretty sure that it is due to a change in the repository since I copied the code and just reinstalled the repo in a new enviroment. In the old enviroment it works fine in the new one it is breaking. This is with the run_object_detection.py script.

Expected behavior

that the model is able to adapt to the new model size and train

@nikitabelooussovbtis
Copy link
Author

The old comment id is: 7c5bd24
The new one is 222505c

@qubvel
Copy link
Member

qubvel commented Feb 28, 2025

@nikitabelooussovbtis
Copy link
Author

@qubvel Awesome thanks

@qubvel
Copy link
Member

qubvel commented Feb 28, 2025

It should be fixed now! Let me know if any other issues left 🤗

@qubvel qubvel closed this as completed Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants