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

Fix ONNX providers with SAM #1340

Closed
wants to merge 1 commit into from

Conversation

Erotemic
Copy link

@Erotemic Erotemic commented Oct 14, 2023

Fixes #1334

The latest version of onnxruntime.InferenceSession seems to require providers are specified. This is a small patch that adds them in. I'm not sure if the values I specified were correct or optimal, but it allows SAM to work on my machine rather than crash.

@hubutui
Copy link

hubutui commented Oct 17, 2023

I think it would be better to change the providers to ["CUDAExecutionProvider", "CPUExecutionProvider"], so we could use cuda first, if failed, then CPU. This also fixes #1317.

@hubutui
Copy link

hubutui commented Oct 17, 2023

I try it but failed. Maybe we still need to check if CUDA is available, and then update the provider list.

@Erotemic
Copy link
Author

Adding the CUDA provider seemed to work fine for me. What's the best way to check for cuda within the dependencies of this repo? Normally I would just use torch.cuda.is_available().

@wkentaro
Copy link
Member

wkentaro commented Dec 30, 2023

Thanks for the report. Fixed via #1364

@wkentaro wkentaro closed this Dec 30, 2023
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.

Crash on clicking "Create AI-polygons"
3 participants