fix(models): Rename fpn_position_encoding to fpn_position_embeddings#43462
Closed
lllangWV wants to merge 1 commit intohuggingface:mainfrom
Closed
fix(models): Rename fpn_position_encoding to fpn_position_embeddings#43462lllangWV wants to merge 1 commit intohuggingface:mainfrom
lllangWV wants to merge 1 commit intohuggingface:mainfrom
Conversation
The dataclass output attribute was named `fpn_position_encoding` but code in `_prepare_vision_features` was accessing `fpn_position_embeddings`, causing an AttributeError. Renamed to `fpn_position_embeddings` across all SAM2, SAM3, and EdgeTAM models for consistency with transformers naming conventions. Affected models: sam2, sam2_video, sam3, sam3_tracker, sam3_tracker_video, sam3_video, edgetam, edgetam_video
Contributor
|
[For maintainers] Suggested jobs to run (before merge) run-slow: edgetam, edgetam_video, sam2, sam2_video, sam3, sam3_tracker, sam3_tracker_video, sam3_video |
Member
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
The dataclass output attribute was named
fpn_position_encodingbut code in_prepare_vision_featureswas accessingfpn_position_embeddings, causing an AttributeError. Renamed tofpn_position_embeddingsacross all SAM2, SAM3, and EdgeTAM models for consistency with transformers naming conventions.Affected models: sam2, sam2_video, sam3, sam3_tracker, sam3_tracker_video, sam3_video, edgetam, edgetam_video
Maybe the other changes where unnecessary, but I like to have consistent naming scheme through similar modules.
I could have just modified
transformers/models/sam3_tracker_video/modeling_sam3_tracker_video.py", line 1912 to
If you all just want the minimal change I can go back and undo the other changes
Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.
doc-builder build transformers docs/source/en --build_dir ~/tmp/test-buildNothing seemed to change. I think the docs for this get automatically updated.tests/models/sam3/test_modeling_sam3.pyWho can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.