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)
|
||||
for i, (name, f, suffix, cpu, gpu) in export.export_formats().iterrows(): # index, (name, file, suffix, CPU, GPU)
|
||||
try:
|
||||
assert i not in (9, 10), f'{name} 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 not in (9, 10), 'inference not supported' # Edge TPU and TF.js are unsupported
|
||||
assert i != 5 or platform.system() == 'Darwin', 'inference only supported on macOS>=10.13' # CoreML
|
||||
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:
|
||||
assert gpu, f'{name} inference not supported on GPU'
|
||||
assert gpu, 'inference not supported on GPU'
|
||||
|
||||
# Export
|
||||
if f == '-':
|
||||
|
Loading…
x
Reference in New Issue
Block a user