-
Notifications
You must be signed in to change notification settings - Fork 972
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
Changes from 11 commits
b0c9a49
fcebd1f
5f5a516
171fcc3
d834a28
bf2c212
815a489
fe529ac
33a8a7e
f9f20f1
85e8be9
95e4566
eef7687
4d8bd40
8e28a72
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,13 @@ 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( | ||
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. 用paddlex的logging模块吧,另外我们使用 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. |
||
"Detected that the current device is a Jetson edge device. Since GPUtil cannot detect GPU on Jetson, the function defaults to returning GPU: 0" | ||
) | ||
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钩子