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

Update conditional logic and -> or in SAM postprocessing #23295

Merged
merged 1 commit into from
May 12, 2023
Merged

Update conditional logic and -> or in SAM postprocessing #23295

merged 1 commit into from
May 12, 2023

Conversation

hwuebben
Copy link
Contributor

should be ors here

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented May 11, 2023

The documentation is not available anymore as the PR was closed or merged.

Copy link
Contributor

@younesbelkada younesbelkada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, I think that it should be as it is, input_points, input_labels and input_boxes are expected to be a list of lists (or a list of lists of lists), hence the and condition

@hwuebben
Copy link
Contributor Author

@younesbelkada exactly but with the current implementation it could also be a list of arrays and the exception would not be thrown

Copy link
Contributor

@younesbelkada younesbelkada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, you are right, that sounds correct to me! Thanks for the heads up

Copy link
Collaborator

@amyeroberts amyeroberts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

@amyeroberts amyeroberts merged commit 65d7b21 into huggingface:main May 12, 2023
@amyeroberts amyeroberts changed the title OR am I crazy? Update conditional logic and -> or in SAM postprocessing May 12, 2023
sheonhan pushed a commit to sheonhan/transformers that referenced this pull request May 15, 2023
@ydshieh
Copy link
Collaborator

ydshieh commented May 15, 2023

FYI, this PR triggered 3 test failures on the CI.

(The third one is GPU OOM, which is likely caused by the other 2 failures).

cc @younesbelkada

tests/models/sam/test_modeling_sam.py::SamModelIntegrationTest::test_inference_mask_generation_one_point_one_bb
(line 235)  ValueError: Input boxes must be a list of list of list of floating integers.
tests/models/sam/test_modeling_sam.py::SamModelIntegrationTest::test_inference_mask_generation_one_point_one_bb_zero
(line 235)  ValueError: Input boxes must be a list of list of list of floating integers.
tests/models/sam/test_modeling_sam.py::SamModelIntegrationTest::test_inference_mask_generation_two_points_batched
(line 808)  torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 2.00 GiB (GPU 0; 14.76 GiB total capacity; 11.65 GiB already allocated; 792.75 MiB free; 12.74 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation.  See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

gojiteji pushed a commit to gojiteji/transformers that referenced this pull request Jun 5, 2023
novice03 pushed a commit to novice03/transformers that referenced this pull request Jun 23, 2023
@karthikdatta98
Copy link

ValueError: Input boxes must be a list of list of list of floating integers. I AM Still getting this error, when even run the example notebooks, what do I do? I just have a list of bounding box coordinated(flatenned)

@younesbelkada
Copy link
Contributor

Hi @karthikdatta98
thanks for reporting, in huggingface/notebooks#409 I modified the notebook accordingly to show how to correctly pass bounding boxes

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

Successfully merging this pull request may close these issues.

6 participants