Skip to content

Commit

Permalink
Use OpenVINO from pip
Browse files Browse the repository at this point in the history
  • Loading branch information
dkurt committed Apr 16, 2021
1 parent 98d5f1c commit 93a3b75
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
4 changes: 0 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,6 @@ RUN apt-get -y update && \

ENV PATH="/opt/deepvariant/bin:${PATH}"

# Setup OpenVINO environment.
ENV LD_LIBRARY_PATH=/opt/intel/openvino/inference_engine/lib/intel64/:/opt/intel/openvino/inference_engine/external/tbb/lib/:/opt/intel/openvino/deployment_tools/ngraph/lib/:$LD_LIBRARY_PATH \
PYTHONPATH=/opt/intel/openvino/python/python3.6/:/opt/intel/openvino/deployment_tools/model_optimizer/:$PYTHONPATH

WORKDIR /opt/deepvariant

CMD ["/opt/deepvariant/bin/run_deepvariant", "--help"]
3 changes: 2 additions & 1 deletion deepvariant/openvino_estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
# POSSIBILITY OF SUCH DAMAGE.
"""An estimator that uses OpenVINO."""
import os
import sys
import subprocess
from absl import logging
import tensorflow as tf
Expand Down Expand Up @@ -88,7 +89,7 @@ def __init__(self, checkpoint_path, input_fn, model):
tensor_shape = input_fn.tensor_shape
freeze_graph(model, checkpoint_path, tensor_shape)
subprocess.run([
mo_tf.__file__, '--input_model=model.pb', '--scale=128',
sys.executable, mo_tf.__file__, '--input_model=model.pb', '--scale=128',
'--mean_values', '[{}]'.format(','.join(['128'] * tensor_shape[-1]))
],
check=True)
Expand Down
12 changes: 3 additions & 9 deletions run-prereq.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ echo "$(pip3 --version)"
note_build_stage "Install python3 packages"

pip3 install "${PIP_ARGS[@]}" contextlib2
pip3 install "${PIP_ARGS[@]}" enum34
pip3 install "${PIP_ARGS[@]}" 'enum34==1.1.8'
pip3 install "${PIP_ARGS[@]}" 'sortedcontainers==2.1.0'
pip3 install "${PIP_ARGS[@]}" 'intervaltree==3.0.2'
pip3 install "${PIP_ARGS[@]}" 'mock>=2.0.0'
Expand Down Expand Up @@ -231,14 +231,8 @@ fi
# OpenVINO
################################################################################
if [[ "${DV_OPENVINO_BUILD}" = "1" ]]; then
sudo -H apt-get install "${APT_ARGS[@]}" apt-transport-https > /dev/null
curl -o GPG-PUB-KEY-INTEL-OPENVINO-2020 https://apt.repos.intel.com/openvino/2020/GPG-PUB-KEY-INTEL-OPENVINO-2020
sudo apt-key add GPG-PUB-KEY-INTEL-OPENVINO-2020
sudo echo "deb https://apt.repos.intel.com/openvino/2020 all main" | sudo tee /etc/apt/sources.list.d/intel-openvino-2020.list
sudo -H apt-get update "${APT_ARGS[@]}" > /dev/null
sudo apt-get install -y --no-install-recommends intel-openvino-dev-ubuntu16-2020.4.287 > /dev/null
rm -f GPG-PUB-KEY-INTEL-OPENVINO-2020
pip3 install "${PIP_ARGS[@]}" networkx defusedxml test-generator==0.1.1
pip3 install "${PIP_ARGS[@]}" git+https://github.com/openvinotoolkit/openvino.git@releases/2021/3#subdirectory=model-optimizer
pip3 install "${PIP_ARGS[@]}" openvino==2021.3
fi

################################################################################
Expand Down

0 comments on commit 93a3b75

Please sign in to comment.