Skip to content

Fix integration tests for SAM - #36397

Merged
qubvel merged 1 commit into
huggingface:mainfrom
qubvel:fix-sam-tests
Feb 25, 2025
Merged

Fix integration tests for SAM#36397
qubvel merged 1 commit into
huggingface:mainfrom
qubvel:fix-sam-tests

Conversation

@qubvel

@qubvel qubvel commented Feb 25, 2025

Copy link
Copy Markdown
Contributor

What does this PR do?

Fix device placement for tensors for pytorch integration tests of SAM model

@qubvel

qubvel commented Feb 25, 2025

Copy link
Copy Markdown
Contributor Author

run-slow: sam

@qubvel qubvel added Tests Related to tests Vision labels Feb 25, 2025
@github-actions

Copy link
Copy Markdown
Contributor

This comment contains run-slow, running the specified jobs: This comment contains run-slow, running the specified jobs:

models: ['models/sam']
quantizations: [] ...

@qubvel
qubvel requested a review from ydshieh February 25, 2025 11:55
@qubvel
qubvel marked this pull request as ready for review February 25, 2025 11:55
@qubvel

qubvel commented Feb 25, 2025

Copy link
Copy Markdown
Contributor Author

Pytorch tests are fixed; only TF fails left, won't fix

FAILED tests/models/sam/test_modeling_tf_sam.py::TFSamModelIntegrationTest::test_inference_mask_generation_three_boxes_point_batch - TypeError: Cannot convert '__empty__' to EagerTensor of dtype int32
FAILED tests/models/sam/test_modeling_tf_sam.py::TFSamModelIntegrationTest::test_inference_mask_generation_two_points_point_batch - TypeError: Cannot convert '__empty__' to EagerTensor of dtype int32
FAILED tests/models/sam/test_processor_sam.py::TFSamProcessorTest::test_rle_encoding - TypeError: Only integers, slices (`:`), ellipsis (`...`), tf.newaxis (`None`) and scalar tf.int32/tf.int64 tensors are valid indices, got <tf.Tensor: shape=(0,), dtype=bool, numpy=array([], dtype=bool)>
===== 3 failed, 109 passed, 192 skipped, 26 warnings in 217.18s (0:03:37) ======

@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@ydshieh ydshieh left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you @qubvel for your kindness!

Hope one day torch.testing.assert_close can take care of this on its own ...

@qubvel
qubvel merged commit fb83bef into huggingface:main Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Tests Related to tests Vision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants