Skip to content

Commit

Permalink
fix darwin platform string (WongKinYiu#454)
Browse files Browse the repository at this point in the history
  • Loading branch information
taka-wang committed Aug 8, 2022
1 parent 4789bd1 commit 8758cdd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion export.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
ct_model = ct.convert(ts, inputs=[ct.ImageType('image', shape=img.shape, scale=1 / 255.0, bias=[0, 0, 0])])
bits, mode = (8, 'kmeans_lut') if opt.int8 else (16, 'linear') if opt.fp16 else (32, None)
if bits < 32:
if sys.platform == 'Darwin': # quantization only supported on macOS
if sys.platform.lower() == 'darwin': # quantization only supported on macOS
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=DeprecationWarning) # suppress numpy==1.20 float warning
ct_model = ct.models.neural_network.quantization_utils.quantize_weights(ct_model, bits, mode)
Expand Down

0 comments on commit 8758cdd

Please sign in to comment.