mirror of
https://github.com/THU-MIG/yolov10.git
synced 2025-05-24 06:14:55 +08:00
Fix get_cpu_info()
bug on Raspberry Pi (#3899)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
965e405957
commit
793443a452
@ -1,5 +1,4 @@
|
|||||||
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
# Ultralytics YOLO 🚀, AGPL-3.0 license
|
||||||
|
|
||||||
import math
|
import math
|
||||||
import os
|
import os
|
||||||
import platform
|
import platform
|
||||||
@ -57,7 +56,11 @@ def get_cpu_info():
|
|||||||
"""Return a string with system CPU information, i.e. 'Apple M2'."""
|
"""Return a string with system CPU information, i.e. 'Apple M2'."""
|
||||||
check_requirements('py-cpuinfo')
|
check_requirements('py-cpuinfo')
|
||||||
import cpuinfo # noqa
|
import cpuinfo # noqa
|
||||||
return cpuinfo.get_cpu_info()['brand_raw'].replace('(R)', '').replace('CPU ', '').replace('@ ', '')
|
|
||||||
|
k = 'brand_raw', 'hardware_raw', 'arch_string_raw' # info keys sorted by preference (not all keys always available)
|
||||||
|
info = cpuinfo.get_cpu_info() # info dict
|
||||||
|
string = info.get(k[0] if k[0] in info else k[1] if k[1] in info else k[2], 'unknown')
|
||||||
|
return string.replace('(R)', '').replace('CPU ', '').replace('@ ', '')
|
||||||
|
|
||||||
|
|
||||||
def select_device(device='', batch=0, newline=False, verbose=True):
|
def select_device(device='', batch=0, newline=False, verbose=True):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user