Thanks to visit codestin.com
Credit goes to github.com

Skip to content

remove .pin_memory() in obj_pos of SAM2Base to resolve and error in MPS#495

Merged
ronghanghu merged 1 commit into
facebookresearch:mainfrom
ronghanghu:ronghanghu/fix_mps_remove_pin_mem
Dec 16, 2024
Merged

remove .pin_memory() in obj_pos of SAM2Base to resolve and error in MPS#495
ronghanghu merged 1 commit into
facebookresearch:mainfrom
ronghanghu:ronghanghu/fix_mps_remove_pin_mem

Conversation

@ronghanghu

Copy link
Copy Markdown
Contributor

In this PR, we remove .pin_memory() in obj_pos of SAM2Base to resolve and error in MPS. Investigations show that .pin_memory() causes an error of Attempted to set the storage of a tensor on device "cpu" to a storage on different device "mps:0", as originally reported in #487.

(close #487)

…r in MPS

In this PR, we remove `.pin_memory()` in `obj_pos` of `SAM2Base` to resolve and error in MPS. Investigations show that `.pin_memory()` causes an error of `Attempted to set the storage of a tensor on device "cpu" to a storage on different device "mps:0"`, as originally reported in facebookresearch#487.

(close facebookresearch#487)
@ronghanghu ronghanghu merged commit 2b90b9f into facebookresearch:main Dec 16, 2024
mahmoudzaouali pushed a commit to mahmoudzaouali/sam2 that referenced this pull request Jul 31, 2025
…r in MPS (facebookresearch#495)

In this PR, we remove `.pin_memory()` in `obj_pos` of `SAM2Base` to resolve and error in MPS. Investigations show that `.pin_memory()` causes an error of `Attempted to set the storage of a tensor on device "cpu" to a storage on different device "mps:0"`, as originally reported in facebookresearch#487.

(close facebookresearch#487)
maximuswatkins pushed a commit to owen24819/CellSam2 that referenced this pull request May 25, 2026
…r in MPS (facebookresearch#495)

In this PR, we remove `.pin_memory()` in `obj_pos` of `SAM2Base` to resolve and error in MPS. Investigations show that `.pin_memory()` causes an error of `Attempted to set the storage of a tensor on device "cpu" to a storage on different device "mps:0"`, as originally reported in facebookresearch#487.

(close facebookresearch#487)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Attempted to set the storage of a tensor on device "cpu" to a storage on different device "mps:0"

3 participants