Skip to content
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

load model onto cpu if cuda isn't available #25

Merged
merged 1 commit into from
Aug 13, 2023

Conversation

eddogola
Copy link
Contributor

Load the model onto cpu if cuda device isn't available

As it stands, the user has to go down to the code to change where the weights/ckpt is loaded into. This fix loads the ckpt into a device dynamically, based on which device is present.

@eddogola
Copy link
Contributor Author

@lkeab

@giswqs
Copy link
Contributor

giswqs commented Aug 13, 2023

I was looking for cpu support as well. Please consider merging this one so that hq-sam behaves the same as SAM. This will make life easier for downstream packages.

@lkeab
Copy link
Collaborator

lkeab commented Aug 13, 2023

Thanks for the suggestion. We follow the code design of SAM in this part. We merged the request.

@rtyley
Copy link

rtyley commented Oct 22, 2023

Many thanks @lkeab & @eddogola for this. The most recent pip release of segment-anything-hq was on 11th August 2023, but this PR was merged 2 days later on 13th August - could you do another pip release that includes this fix?

Note that thanks to pip's ability to install from VCS, as a workaround you can specify the package in a requirements.txt file as a direct link to the latest commit of this repo:

segment-anything-hq @ git+https://github.com/SysCV/sam-hq@5fd027ec559806dec9f876b56938175a63dfc625

...however, this will currently fail, until the issue mentioned in #83 is fixed...

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.

5 participants