Skip to content

Commit

Permalink
added mo 2021.4 patch
Browse files Browse the repository at this point in the history
  • Loading branch information
kozlov721 committed Oct 10, 2024
1 parent 6b7dcd2 commit 031b46a
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 19 deletions.
26 changes: 26 additions & 0 deletions docker/patches/mo-2021.4.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
--- /opt/intel/deployment_tools/model_optimizer/mo/main.py 2021-06-22 20:30:31.000000000 +0000
+++ shared_with_container/main.py 2024-10-10 12:47:05.718612915 +0000
@@ -29,7 +29,7 @@
from mo.utils.cli_parser import get_placeholder_shapes, get_tuple_values, get_model_name, \
get_common_cli_options, get_caffe_cli_options, get_tf_cli_options, get_mxnet_cli_options, get_kaldi_cli_options, \
get_onnx_cli_options, get_mean_scale_dictionary, parse_tuple_pairs, get_freeze_placeholder_values, get_meta_info, \
- parse_transform, check_available_transforms
+ parse_transform, check_available_transforms, parse_input_value
from mo.utils.error import Error, FrameworkError
from mo.utils.find_ie_version import find_ie_version
from mo.utils.get_ov_update_message import get_ov_update_message
@@ -206,7 +206,13 @@

mean_values = parse_tuple_pairs(argv.mean_values)
scale_values = parse_tuple_pairs(argv.scale_values)
- mean_scale = get_mean_scale_dictionary(mean_values, scale_values, argv.input)
+
+ __input_names = []
+ for input_value in argv.input.split(','):
+ __node_name = parse_input_value(input_value)[0]
+ __input_names.append(__node_name)
+ __input_names = ",".join(__input_names)
+ mean_scale = get_mean_scale_dictionary(mean_values, scale_values, __input_names)
argv.mean_scale_values = mean_scale

if not os.path.exists(argv.output_dir):
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
--- convert_impl.py 2023-08-09 14:48:35.300720667 +0000
+++ /usr/local/lib/python3.8/site-packages/openvino/tools/mo/convert_impl.py 2023-08-09 14:50:48.555078595 +0000
@@ -275,7 +275,7 @@

mean_values = parse_tuple_pairs(argv.mean_values)
scale_values = parse_tuple_pairs(argv.scale_values)
- mean_scale = get_mean_scale_dictionary(mean_values, scale_values, argv.input)
+ mean_scale = get_mean_scale_dictionary(mean_values, scale_values, ','.join(argv.inputs_list))
argv.mean_scale_values = mean_scale
argv.layout_values = get_layout_values(argv.layout, argv.source_layout, argv.target_layout)

14 changes: 9 additions & 5 deletions docker/rvc2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ COPY --link docker/extra_packages/openvino-${VERSION}.tar.gz .
COPY --link requirements.txt requirements.txt
COPY --link docker/rvc2/requirements.txt requirements-rvc2.txt

COPY --link docker/extra_packages/mo_patch.diff .

RUN <<EOF

set -e
Expand Down Expand Up @@ -67,14 +65,20 @@ RUN <<EOF

EOF

COPY --link docker/patches /patches

RUN <<EOF

set -e

# Model Optimizer contains a bug in
# version 2022.3.0 that needs to be patched
# Model Optimizer contains a bug in both versions
# that needs to be patched
if [ "${VERSION}" = "2022.3.0" ]; then
patch /usr/local/lib/python3.8/site-packages/openvino/tools/mo/convert_impl.py < /mo_patch.diff
patch /usr/local/lib/python3.8/site-packages/openvino/tools/mo/convert_impl.py \
< /patches/mo-2022.3.patch
else
patch /opt/intel/deployment_tools/model_optimizer/mo/main.py \
< /patches/mo-2021.4.patch
fi

EOF
Expand Down
12 changes: 0 additions & 12 deletions docker/scripts/install_openssl.sh

This file was deleted.

0 comments on commit 031b46a

Please sign in to comment.