Simplify benchmarks.py assertions (#8515)
Browse files- utils/benchmarks.py +4 -4
utils/benchmarks.py
CHANGED
@@ -61,12 +61,12 @@ def run(
|
|
61 |
device = select_device(device)
|
62 |
for i, (name, f, suffix, cpu, gpu) in export.export_formats().iterrows(): # index, (name, file, suffix, CPU, GPU)
|
63 |
try:
|
64 |
-
assert i not in (9, 10),
|
65 |
-
assert i != 5 or platform.system() == 'Darwin',
|
66 |
if 'cpu' in device.type:
|
67 |
-
assert cpu,
|
68 |
if 'cuda' in device.type:
|
69 |
-
assert gpu,
|
70 |
|
71 |
# Export
|
72 |
if f == '-':
|
|
|
61 |
device = select_device(device)
|
62 |
for i, (name, f, suffix, cpu, gpu) in export.export_formats().iterrows(): # index, (name, file, suffix, CPU, GPU)
|
63 |
try:
|
64 |
+
assert i not in (9, 10), 'inference not supported' # Edge TPU and TF.js are unsupported
|
65 |
+
assert i != 5 or platform.system() == 'Darwin', 'inference only supported on macOS>=10.13' # CoreML
|
66 |
if 'cpu' in device.type:
|
67 |
+
assert cpu, 'inference not supported on CPU'
|
68 |
if 'cuda' in device.type:
|
69 |
+
assert gpu, 'inference not supported on GPU'
|
70 |
|
71 |
# Export
|
72 |
if f == '-':
|