openvinotoolkit / docker_ci

The framework to generate a Dockerfile, build, test, and deploy a docker image with OpenVINO™ toolkit.
Apache License 2.0
58 stars 63 forks source link

Running script on pre-built docker images #271

Closed AndreaTantucci closed 1 year ago

AndreaTantucci commented 1 year ago

I am trying to run an inference on MYRIAD by using Docker. I have downloaded the pre-built image openvino/ubuntu20_runtime:20221.4.2 and i would like to use this image as a base for another Docker image in which i will load my code and my python packages.

Can someone guide me in doing this, because i have tried multiple times but it always gives me an error on the myriad plugin. Below is my Dockerfile and the error i get when i execute with docker-compose. The requirements.txt contains: numpy openvino==2021.4.2 pillow yappi

`FROM openvino/ubuntu20_runtime:2021.4.2

USER root

ENV TINI_VERSION="v0.19.0"

ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini RUN chmod +x /tini

ENV PYTHONDONTWRITEBYTECODE=1

ENV PYTHONUNBUFFERED=1

RUN pip install -U \ pip \ setuptools \ wheel

WORKDIR /home/openvino

USER openvino

COPY ./code . RUN python3 -m pip install -r requirements.txt RUN python3 -m pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/cpu

COPY ./libmyriadPlugin.so /home/openvino/.local/lib/python3.8/site-packages/openvino/libs COPY ./usb-ma2x8x.mvcmd /home/openvino/.local/lib/python3.8/site-packages/openvino/libs

ENTRYPOINT ["/tini", "--"]`

Activating Openvino Environment variables unibap_inference_script-inference_container-1 | [setupvars.sh] OpenVINO environment initialized unibap_inference_script-inference_container-1 | Traceback (most recent call last): unibap_inference_script-inference_container-1 | File "main.py", line 102, in <module> unibap_inference_script-inference_container-1 | OnBoard.Unibap_Algorithm(model_path, weights_path, input_path, output_path, camera_fps, DEVICE, profiler, dim, n_channels, unibap_inference_script-inference_container-1 | File "/home/openvino/OnBoard_Algorithm.py", line 37, in Unibap_Algorithm unibap_inference_script-inference_container-1 | compiled_inference_model_ir = iecore.load_network(network = inference_model_ir, device_name = DEVICE) unibap_inference_script-inference_container-1 | File "ie_api.pyx", line 403, in openvino.inference_engine.ie_api.IECore.load_network unibap_inference_script-inference_container-1 | File "ie_api.pyx", line 442, in openvino.inference_engine.ie_api.IECore.load_network unibap_inference_script-inference_container-1 | RuntimeError: Failed to create plugin /home/openvino/.local/lib/python3.8/site-packages/openvino/inference_engine/../../openvino/libs/libmyriadPlugin.so for device MYRIAD unibap_inference_script-inference_container-1 | Please, check your environment unibap_inference_script-inference_container-1 | Cannot load library '/home/openvino/.local/lib/python3.8/site-packages/openvino/inference_engine/../../openvino/libs/libmyriadPlugin.so': libinference_engine_legacy.so: cannot open shared object file: No such file or directory

Thanks