Skip to content

fix tests/models/edgetam_video/test_modeling_edgetam_video.py#42867

Closed
sywangyi wants to merge 1 commit intohuggingface:mainfrom
sywangyi:crash_sam2
Closed

fix tests/models/edgetam_video/test_modeling_edgetam_video.py#42867
sywangyi wants to merge 1 commit intohuggingface:mainfrom
sywangyi:crash_sam2

Conversation

@sywangyi
Copy link
Copy Markdown
Contributor

and tests/models/sam2_video/test_modeling_sam2_video.py crash

fix crash like
FAILED tests/models/edgetam_video/test_modeling_edgetam_video.py::EdgeTamVideoModelIntegrationTest::test_inference_mask_generation_video_multi_objects_multi_points - AttributeError: positional_embedding is not an nn.Parameter

and tests/models/sam2_video/test_modeling_sam2_video.py crash

Signed-off-by: Wang, Yi <yi.a.wang@intel.com>
@github-actions
Copy link
Copy Markdown
Contributor

[For maintainers] Suggested jobs to run (before merge)

run-slow: edgetam_video, sam2_video

@sywangyi
Copy link
Copy Markdown
Contributor Author

@SunMarc please help review.
wo the fix the tests/models/sam2_video/test_modeling_sam2_video.py and tests/models/edgetam_video/test_modeling_edgetam_video.py all fail

Copy link
Copy Markdown
Member

@SunMarc SunMarc 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 checking, while this might fix the tests, I'm sure this will probably lead to another issues as . cc @molbap @ArthurZucker

The comment below is probably connected to this issue:

# need to be ignored, as it's a buffer and will not be correctly detected as tied weight
_keys_to_ignore_on_load_missing = ["prompt_encoder.shared_embedding.positional_embedding"]

@sywangyi
Copy link
Copy Markdown
Contributor Author

Thanks for checking, while this might fix the tests, I'm sure this will probably lead to another issues as . cc @molbap @ArthurZucker

The comment below is probably connected to this issue:

# need to be ignored, as it's a buffer and will not be correctly detected as tied weight
_keys_to_ignore_on_load_missing = ["prompt_encoder.shared_embedding.positional_embedding"]

I see https://github.com/huggingface/transformers/blob/64c12fdf5f6a35704f2932db533c76973b1e9a30/src/transformers/models/sam_hq/modular_sam_hq.py#L445, it only contains _keys_to_ignore_on_load_missing wo tied weight

@sywangyi
Copy link
Copy Markdown
Contributor Author

same with #42840, so could be closed

@sywangyi sywangyi closed this Dec 15, 2025
@SunMarc
Copy link
Copy Markdown
Member

SunMarc commented Dec 16, 2025

Thanks !

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.

2 participants