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

Unable to follow Object Detection Task Example due to ImageProcessor error #25666

Closed
2 of 4 tasks
govindrai opened this issue Aug 22, 2023 · 4 comments
Closed
2 of 4 tasks

Comments

@govindrai
Copy link

govindrai commented Aug 22, 2023

System Info

transformers 4.3.2
python 3.10
using google colab

Who can help?

@amyeroberts, @sgugger, @stevhliu

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

Follow official tutorial instructions:
After applying a transform function to the CPPE5 dataset and trying to load a single element fails with the following error:

TypeError                                 Traceback (most recent call last)
[<ipython-input-75-e2a7222a96ab>](https://localhost:8080/#) in <cell line: 22>()
     20 
     21 cppe5["train"] = cppe5["train"].with_transform(transform_aug_ann)
---> 22 cppe5["train"][15]

9 frames
[/usr/local/lib/python3.10/dist-packages/transformers/models/detr/image_processing_detr.py](https://localhost:8080/#) in <listcomp>(.0)
   1285             if annotations is not None:
   1286                 annotations = [
-> 1287                     self.normalize_annotation(
   1288                         annotation, get_image_size(image, input_data_format), input_data_format=input_data_format
   1289                     )

TypeError: DetrImageProcessor.normalize_annotation() got an unexpected keyword argument 'input_data_format'

Here's a colab notebook so you test/run it easily. Go to the last step to view the error:
https://colab.research.google.com/drive/1WtwFcW7_N5N7VLsoswx2U4O8CBkCRNc4?usp=sharing

Expected behavior

I expect to not encounter a failure and continue the tutorial.

@ArthurZucker
Copy link
Collaborator

cc @amyeroberts seems to come from #25464

@amyeroberts
Copy link
Collaborator

Hi @govindrai, thanks for raising this issue!

Yes, this was a bug introduced in #25464. A fix was merged in yesterday in #25643 on main. Installing from source should resolve the issue.

@govindrai
Copy link
Author

Thank you, all! That fixes it :).

For others, run !pip install git+https://github.com/huggingface/transformers to install from source.

@amyeroberts
Copy link
Collaborator

@govindrai The fix has now been included as part of a patch release and can be directly installed from pypi with pip install transformers

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

3 participants