diff --git a/deploy/OpenVINO/export_openvino.py b/deploy/OpenVINO/export_openvino.py index 2aaa7026..48d8a87f 100644 --- a/deploy/OpenVINO/export_openvino.py +++ b/deploy/OpenVINO/export_openvino.py @@ -83,8 +83,12 @@ try: LOGGER.info('\nStarting to export OpenVINO...') import_file = args.weights.replace('.pt', '.onnx') - export_dir = str(import_file).replace('.onnx', '_openvino') - cmd = f"mo --input_model {import_file} --output_dir {export_dir} --data_type {'FP16' if args.half else 'FP32'}" + if args.half: + export_dir = str(import_file).replace('.onnx', '_openvino') + cmd = f"mo --input_model {import_file} --output_dir {export_dir}" + else: + export_dir = str(import_file).replace('.onnx', '_openvino_fp16') + cmd = f"mo --input_model {import_file} --output_dir {export_dir} --compress_to_fp16" subprocess.check_output(cmd.split()) LOGGER.info(f'OpenVINO export success, saved as {export_dir}') except Exception as e: