mirror of
https://github.com/ultralytics/yolov5.git
synced 2025-06-03 14:49:29 +08:00
Simplify benchmarks.py assertions (#8515)
This commit is contained in:
parent
3e54651fca
commit
f17444abcd
@ -61,12 +61,12 @@ def run(
|
|||||||
device = select_device(device)
|
device = select_device(device)
|
||||||
for i, (name, f, suffix, cpu, gpu) in export.export_formats().iterrows(): # index, (name, file, suffix, CPU, GPU)
|
for i, (name, f, suffix, cpu, gpu) in export.export_formats().iterrows(): # index, (name, file, suffix, CPU, GPU)
|
||||||
try:
|
try:
|
||||||
assert i not in (9, 10), f'{name} inference not supported' # Edge TPU and TF.js are unsupported
|
assert i not in (9, 10), 'inference not supported' # Edge TPU and TF.js are unsupported
|
||||||
assert i != 5 or platform.system() == 'Darwin', f'{name} inference only supported on macOS>=10.13'
|
assert i != 5 or platform.system() == 'Darwin', 'inference only supported on macOS>=10.13' # CoreML
|
||||||
if 'cpu' in device.type:
|
if 'cpu' in device.type:
|
||||||
assert cpu, f'{name} inference not supported on CPU'
|
assert cpu, 'inference not supported on CPU'
|
||||||
if 'cuda' in device.type:
|
if 'cuda' in device.type:
|
||||||
assert gpu, f'{name} inference not supported on GPU'
|
assert gpu, 'inference not supported on GPU'
|
||||||
|
|
||||||
# Export
|
# Export
|
||||||
if f == '-':
|
if f == '-':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user