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

python opencv_dnn_infer.py 是默认使用cpu还是gpu,想切换gpu要怎么办? #102

Open
fumingren opened this issue Aug 18, 2021 · 5 comments

Comments

@fumingren
Copy link

No description provided.

@xinnie-the-pooh
Copy link

默认CPU

@fumingren
Copy link
Author

能换gpu吗

@xinnie-the-pooh
Copy link

这个得用对应版本cuda框架 但是程序貌似没有引用 (仅限于模型执行过程)

@fumingren
Copy link
Author

好的谢谢哈

@fumingren
Copy link
Author

可通过换下面代码解决换gpu问题
Net = cv2.dnn.readNetFromCaffe(args.proto, args.model)
Net.setPreferableBackend(cv2.dnn.DNN_BACKEND_CUDA)
Net.setPreferableTarget(cv2.dnn.DNN_TARGET_CUDA)

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

No branches or pull requests

2 participants