-
Notifications
You must be signed in to change notification settings - Fork 974
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
Develop: rectify face_recognition.yaml & PP-ShiTuV2.yaml, del device=gpu. #2705
base: develop
Are you sure you want to change the base?
Changes from 8 commits
b0c9a49
fcebd1f
5f5a516
171fcc3
d834a28
bf2c212
815a489
fe529ac
33a8a7e
f9f20f1
85e8be9
95e4566
eef7687
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,8 +14,8 @@ | |
|
||
import os | ||
import GPUtil | ||
import lazy_paddle as paddle | ||
|
||
import lazy_paddle as paddle | ||
from . import logging | ||
from .errors import raise_unsupported_device_error | ||
|
||
|
@@ -32,6 +32,11 @@ def _constr_device(device_type, device_ids): | |
|
||
def get_default_device(): | ||
avail_gpus = GPUtil.getAvailable() | ||
if not avail_gpus: | ||
# maybe edge devices like Jetson | ||
if os.path.exists("/etc/nv_tegra_release"): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这种方式看起来有点儿hack,建议加一句debug日志 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. DONE。 |
||
avail_gpus = [0] | ||
# print(f"* DEBUG: avail_gpus = {avail_gpus}") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 去掉调试用的注释 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 在最新的commit里已经删除。 |
||
if not avail_gpus: | ||
return "cpu" | ||
else: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
需确认下是否安装了pre-commit钩子