Skip to content

Commit 9682fc0

Browse files
authored
Update export.py
#108
1 parent 5a40b88 commit 9682fc0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

export.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,10 @@ def export_openvino(file, metadata, half, prefix=colorstr('OpenVINO:')):
207207
LOGGER.info(f'\n{prefix} starting export with openvino {ie.__version__}...')
208208
f = str(file).replace('.pt', f'_openvino_model{os.sep}')
209209

210-
cmd = f"mo --input_model {file.with_suffix('.onnx')} --output_dir {f} --data_type {'FP16' if half else 'FP32'}"
210+
#cmd = f"mo --input_model {file.with_suffix('.onnx')} --output_dir {f} --data_type {'FP16' if half else 'FP32'}"
211+
#cmd = f"mo --input_model {file.with_suffix('.onnx')} --output_dir {f} {"--compress_to_fp16" if half else ""}"
212+
half_arg = "--compress_to_fp16" if half else ""
213+
cmd = f"mo --input_model {file.with_suffix('.onnx')} --output_dir {f} {half_arg}"
211214
subprocess.run(cmd.split(), check=True, env=os.environ) # export
212215
yaml_save(Path(f) / file.with_suffix('.yaml').name, metadata) # add metadata.yaml
213216
return f, None

0 commit comments

Comments
 (0)