-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attempted to set the storage of a tensor on device "cpu" to a storage on different device "mps:0" #487
Comments
Same problem. |
…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)
…r in MPS (#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 #487. (close #487)
Thank you for the fast and accurate fix.
… On Dec 15, 2024, at 4:08 PM, Ronghang Hu ***@***.***> wrote:
Hi @pwaver <https://github.com/pwaver> @byy-yby <https://github.com/byy-yby> thanks for reporting this issue! I made a patch for the MPS device in #495 <#495>
—
Reply to this email directly, view it on GitHub <#487 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AHMBV6V5GWTEZOBUOOIH3CL2FXVWHAVCNFSM6AAAAABTPAHEXKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNBUGA3DMOBRHE>.
You are receiving this because you were mentioned.
|
@pwaver can you solve this problem by just delete the .pin_momeory?, it seems useless for me. interesting |
Yes, I solved it by removing .pin_memory() (and then deleting __pychache__). But on the git site it seems this is not pulled into the main distribution so you may just re install sam2.Sent from my iPadOn Dec 16, 2024, at 11:23 AM, byy-yby ***@***.***> wrote:
@pwaver can you solve this problem by just delete the .pin_momeory?, it seems useless for me. interesting
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Hi @pwaver, please try pulling the latest code -- it's been merged to https://github.com/facebookresearch/sam2/blob/main/sam2/modeling/sam2_base.py in 2b90b9f |
@pwaver @ronghanghu thank you for your help! I have solved this problem by delete pychache and reinstall sam2. |
When i use mps or cpu to run the video-predictor code in notebook, everything about picture segment is ok, but when it comes to the video predictor, the code go wrong like this:
sonthing meet same problem with me? my device is mbp m4The text was updated successfully, but these errors were encountered: