Skip to content

Conversation

@ronghanghu
Copy link
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
2 checks passed
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)
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