Community
cancel
Showing results for 
Search instead for 
Did you mean: 
jonnymo
Novice
253 Views

OpenVINO Toolkit for Raspbian OS from a Docker Image shows platform warnings during Docker build

I am following the OpenVINO Toolkit for Raspbian OS from a Docker Image instructions from the following link but I am seeing some platform warnings during the Docker build:

Link:

https://www.intel.com/content/www/us/en/support/articles/000055220/boards-and-kits.html 

 

This is on a Raspberry Pi 4 running the latest Raspbian Image:

$ uname -a
Linux raspberrypi 5.4.83-v7l+ #1379 SMP Mon Dec 14 13:11:54 GMT 2020 armv7l GNU/Linux

 

I used the 'get-docker.sh' script to download Docker and added the following changes to the Dockerfile for the 2021.2 version of the OpenVINO Toolkit:

ARG DOWNLOAD_LINK=https://download.01.org/opencv/2021/openvinotoolkit/2021.2/l_openvino_toolkit_runtime_raspbian_p_2021.2.185.tgz

https://download.01.org/opencv/2021/openvinotoolkit/2021.2/open_model_zoo/models_bin/3/person-vehicle-bike-detection-crossroad-0078/FP16/person-vehicle-bike-detection-crossroad-0078.bin
https://download.01.org/opencv/2021/openvinotoolkit/2021.2/open_model_zoo/models_bin/3/person-vehicle-bike-detection-crossroad-0078/FP16/person-vehicle-bike-detection-crossroad-0078.xml
https://cdn.pixabay.com/photo/2018/07/06/00/33/person-3519503_960_720.jpg  

Command used to build the Docker container:

 $ docker build . -t openvino-rpi

These are the messages I am seeing:

update-alternatives: using /usr/share/icons/Adwaita/cursor.theme to provide /usr/share/icons/default/index.theme (x-cursor-theme) in auto mode
Setting up libsoup-gnome2.4-1:armhf (2.64.2-2) ...
Setting up librest-0.7-0:armhf (0.8.1-1) ...
Setting up libgtk-3-0:armhf (3.24.5-1+rpt2) ...
Processing triggers for systemd (241-7~deb10u5+rpi1) ...
Processing triggers for libc-bin (2.28-10+rpi1) ...
Processing triggers for libgdk-pixbuf2.0-0:armhf (2.38.1+dfsg-1) ...
Removing intermediate container 0bb5f7e4f709
 ---> 4031d217236f
Step 8/11 : RUN mkdir -p $INSTALL_DIR && cd $INSTALL_DIR &&    wget -c $DOWNLOAD_LINK &&    tar xf l_openvino_toolkit_runtime_raspbian_p*.tgz --strip 1 -C $INSTALL_DIR
 ---> [Warning] The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm/v7) and no specific platform was requested
 ---> Running in 15728709580f
--2021-01-31 05:09:07--  https://download.01.org/opencv/2021/openvinotoolkit/2021.2/l_openvino_toolkit_runtime_raspbian_p_2021.2.185.tgz

 

Saving to: ‘/root/Downloads/walk.jpg’

     0K .......... .......... .......... .......... .......... 30% 3.91M 0s
    50K .......... .......... .......... .......... .......... 60% 1.28M 0s
   100K .......... .......... .......... .......... .......... 90% 3.95M 0s
   150K .......... .....                                      100% 9.53M=0.06s

2021-01-31 05:10:03 (2.50 MB/s) - ‘/root/Downloads/walk.jpg’ saved [169104/169104]

Removing intermediate container 0f8dbdc472b8
 ---> 784ca9611764
Step 11/11 : RUN echo "import cv2 as cv\nnet = cv.dnn.readNet('person-vehicle-bike-detection-crossroad-0078.xml','person-vehicle-bike-detection-crossroad-0078.bin')\nnet.setPreferableTarget(cv.dnn.DNN_TARGET_MYRIAD)\nframe = cv.imread('walk.jpg')\nif frame is None:\n   raise Exception('Image not found!')\nblob = cv.dnn.blobFromImage(frame, size=(1024, 1024), ddepth=cv.CV_8U)\nnet.setInput(blob)\nout = net.forward()\nfor detection in out.reshape(-1, 7):\n   confidence = float(detection[2])\n   xmin = int(detection[3] * frame.shape[1])\n   ymin = int(detection[4] * frame.shape[0])\n   xmax = int(detection[5] * frame.shape[1])\n   ymax = int(detection[6] * frame.shape[0])\n   if confidence > 0.5:\n      cv.rectangle(frame, (xmin, ymin), (xmax, ymax), color=(0, 255, 0))\ncv.imwrite('out.png', frame)\nprint('Detection results in out.png')" >> /root/Downloads/openvino_fd_myriad.py
 ---> [Warning] The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm/v7) and no specific platform was requested
 ---> Running in d00590f3b322
Removing intermediate container d00590f3b322
 ---> 4b1b453a4291
Successfully built 4b1b453a4291
Successfully tagged openvino-rpi:latest

 

Are these something to be concerned with?

The "raise Exception('Image not found!')\nblob" entry looks a bit concerning as well.

 

 

0 Kudos
12 Replies
IntelSupport
Community Manager
234 Views

 

Hi Jonnymo,

Thanks for reaching out.

That warning seems like you force for a specific platform. What is your docker version? Please share the screenshot of your docker version details.

 

Regards,

Aznie


jonnymo
Novice
222 Views

I followed the instructions for installing Docker on Raspbian which too me to this link:

https://docs.docker.com/engine/install/debian/ 

This took me to the section "Install using the convenience script" for the convenience script when using Raspbian.

https://docs.docker.com/engine/install/debian/#install-using-the-convenience-script 

 

I then downloaded and ran the 'get-docker.sh' script which I assumed would detect the Raspberry Pi platform.

The version of Docker installed is:

pi@raspberrypi:~/develop $ docker --version
Docker version 20.10.2, build 2291f61

 

The images that were pulled during the Docker run are:

pi@raspberrypi:~/develop $ docker images
REPOSITORY               TAG       IMAGE ID       CREATED        SIZE
openvino-rpi             latest    bedc5eed4b48   41 hours ago   907MB
balenalib/rpi-raspbian   latest    51b1ef245ec9   3 weeks ago    111MB

 

 

Thanks.

IntelSupport
Community Manager
201 Views

Hi Jonnymo,

This might be a bug in Docker version 20.10.2, I have found many users face the same issue using this version. I would suggest you use a stable version of Docker 19.03.13.

 

Regards,

Aznie


jonnymo
Novice
198 Views

Stable according to what?

From what I see from the Docker site, the most recent is Docker version is 20.10.3 and 19.03.19 is many versions behind.

Also, apparently there was an update to Docker with Raspbian so the current version now shows 20.10.3.

 docker --version
Docker version 20.10.3, build 48d30b5

 

Luis_at_Intel
Moderator
180 Views

Hi Jonnymo,

 

Glancing at the ARG DOWNLOAD_LINK in your original post, looks like some lines are missing their corresponding ARG as shown in the sample Dockerfile. I assume you do have them set, just verify you have ARG BIN_FILE, ARG WEIGHTS_FILE and ARG IMAGE_FILE with their corresponding value/URL.

 

The "raise Exception('Image not found!')" seems to be part of the openvino_fd_myriad.py script written by the Docker instructions. This is an automated step that is writing and saving the contents of the Python script for you (unless you are getting that exception from actually running the openvino_fd_myriad.py script, then it may be an issue with the given input image). In other words, this "exception" seems to be expected for process of building this Docker image. 

 

The [Warning] The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm/v7) seems to be a mismatch between the Host/Target OS and the Docker image OS. If you don't mind please share your Raspberry PI OS, you can do this by executing and sharing the ouput of $ cat /etc/*release. If warnings persist, please share your Dockerfile with us. Let us know if you have any additional questions or if you face any other issues.

 

 

Regards,

Luis

 

jonnymo
Novice
170 Views

This is what is in the Dockerfile I am using. I had adjusted the ARG entries to reflect the 2021.2 OpenVINO Release.

$ cat Dockerfile


FROM balenalib/rpi-raspbian:latest

ARG DOWNLOAD_LINK=https://download.01.org/opencv/2021/openvinotoolkit/2021.2/l_openvino_toolkit_runtime_raspbian_p_2021.2.185.tgz
ARG INSTALL_DIR=/opt/intel/openvino
ARG BIN_FILE=https://download.01.org/opencv/2021/openvinotoolkit/2021.2/open_model_zoo/models_bin/3/person-vehicle-bike-detection-crossroad-0078/FP16/person-vehicle-bike-detection-crossroad-0078.bin
ARG WEIGHTS_FILE=https://download.01.org/opencv/2021/openvinotoolkit/2021.2/open_model_zoo/models_bin/3/person-vehicle-bike-detection-crossroad-0078/FP16/person-vehicle-bike-detection-crossroad-0078.xml
ARG IMAGE_FILE=https://cdn.pixabay.com/photo/2018/07/06/00/33/person-3519503_960_720.jpg

RUN apt-get update && apt-get install -y --no-install-recommends \
   apt-utils \
   automake \
   cmake \
   cpio \
   gcc \
   g++ \
   libatlas-base-dev \
   libstdc++6 \
   libtool \
   libusb-1.0.0-dev \
   lsb-release \
   make \
   python3-pip \
   python3-numpy \
   python3-scipy \
   libgtk-3-0 \
   pkg-config \
   libavcodec-dev \
   libavformat-dev \
   libswscale-dev \
   sudo \
   udev \
   unzip \
   vim \
   git \
   wget && \
rm -rf /var/lib/apt/lists/*
RUN pip3 install --no-cache-dir setuptools && \
    pip3 install --no-cache-dir jupyter
RUN mkdir -p $INSTALL_DIR && cd $INSTALL_DIR && \
   wget -c $DOWNLOAD_LINK && \
   tar xf l_openvino_toolkit_runtime_raspbian_p*.tgz --strip 1 -C $INSTALL_DIR
# add USB rules
RUN sudo usermod -a -G users "$(whoami)" && \
   /bin/bash -c "source $INSTALL_DIR/bin/setupvars.sh && \
   sh $INSTALL_DIR/install_dependencies/install_NCS_udev_rules.sh"
# build Object Detection sample
RUN echo "source /opt/intel/openvino/bin/setupvars.sh" >> ~/.bashrc && \
   mkdir /root/Downloads && \
   cd $INSTALL_DIR/deployment_tools/inference_engine/samples/c/ && \
   /bin/bash -c "source $INSTALL_DIR/bin/setupvars.sh && \
   ./build_samples.sh && \
   wget --no-check-certificate $BIN_FILE -O /root/Downloads/person-vehicle-bike-detection-crossroad-0078.bin && \
   wget --no-check-certificate $WEIGHTS_FILE -O /root/Downloads/person-vehicle-bike-detection-crossroad-0078.xml && \
   wget --no-check-certificate $IMAGE_FILE -O /root/Downloads/walk.jpg "
RUN echo "import cv2 as cv\n\
# Load the model.\n\
net = cv.dnn.readNet('person-vehicle-bike-detection-crossroad-0078.xml',\
'person-vehicle-bike-detection-crossroad-0078.bin')\n\
# Specify target device.\n\
net.setPreferableTarget(cv.dnn.DNN_TARGET_MYRIAD)\n\
# Read an image.\n\
frame = cv.imread('walk.jpg')\n\
if frame is None:\n\
   raise Exception('Image not found!')\n\
# Prepare input blob and perform an inference.\n\
blob = cv.dnn.blobFromImage(frame, size=(1024, 1024), ddepth=cv.CV_8U)\n\
net.setInput(blob)\n\
out = net.forward()\n\
# Draw detected faces on the frame.\n\
for detection in out.reshape(-1, 7):\n\
   confidence = float(detection[2])\n\
   xmin = int(detection[3] * frame.shape[1])\n\
   ymin = int(detection[4] * frame.shape[0])\n\
   xmax = int(detection[5] * frame.shape[1])\n\
   ymax = int(detection[6] * frame.shape[0])\n\
   if confidence > 0.5:\n\
      cv.rectangle(frame, (xmin, ymin), (xmax, ymax), color=(0, 255, 0))\n\
# Save the frame to an image file.\n\
cv.imwrite('out.png', frame)\n\
print('Detection results in out.png')" >> /root/Downloads/openvino_fd_myriad.py

 

This is the output of os-release from the Raspberry Pi 4 that is hosting the Docker instance.

$ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

 

Output of 'os-release' from the Raspbian OS Docker Container running on a Raspberry Pi 4

root@raspberrypi:~/Downloads# cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

 

The 'openvino_fd_myriad.py' script seems to run fine within the Raspbian OS Docker container.

root@raspberrypi:~/Downloads# python3 openvino_fd_myriad.py
Detection results in out.png

 

This is the output of the 'out.png' running 'openvino_fd_myriad.py' in the Docker container.

raspi_docker_openvino_test.png

 

jonnymo
Novice
161 Views

Oh, when starting the Docker container, this is seen:

pi@raspberrypi:~/docker $ docker run -it --privileged -v /dev:/dev --network=host openvino-rpi
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm/v7) and no specific platform was requested
[setupvars.sh] OpenVINO environment initialized

 

NOTE: This is running on a Raspberry Pi 4 with Raspbian 10 installed, so I am not sure where the reference to 'linux/amd64' is coming from. 

Munesh_Intel
Moderator
127 Views

Hi Jon,

We’ve checked and confirmed that this is expected message for new Docker version. If you don’t want to see the indicated error, you can either:

1) Roll back to earlier version (Docker 19.03.13) .

2) Continue to use Docker 20.10.3 with workaround. Run the image when explicitly passing  --platform=linux/arm/v7 on docker run/docker pull. You can refer to the following GitHub issue and comment for more information.

https://github.com/docker/for-linux/issues/1170)

https://github.com/docker/for-linux/issues/1170#issuecomment-750311549

 

Regards,

Munesh


jonnymo
Novice
119 Views

I'll give these a try.

Thanks

jonnymo
Novice
54 Views

Passing " --platform=linux/arm/v7" to the build step results in the following:

pi@raspberrypi:~/docker $ docker build . -t openvino-rpi --platform=linux/arm/v7Sending build context to Docker daemon  1.306MB
Step 1/12 : FROM balenalib/rpi-raspbian:latest
latest: Pulling from balenalib/rpi-raspbian
20e06662a7a2: Pull complete 
bbe977187d35: Pull complete 
1c62e9e51efe: Pull complete 
ab4813588625: Pull complete 
70c0b6627ae8: Pull complete 
0483f1a5a01b: Pull complete 
8cc1424b602b: Pull complete 
Digest: sha256:566d3d4aec9b3cef82ddc79a5d98cbf1959cae17d2890dccfc0143b44ce49645
Status: Downloaded newer image for balenalib/rpi-raspbian:latest
image with reference balenalib/rpi-raspbian:latest was found but does not match the specified platform: wanted linux/arm/v7, actual: linux/amd64

 

With out the platform options, the resulting Docker image(s) shows the following Architecture:

pi@raspberrypi:~/docker $ docker image inspect openvino-rpi:latest | grep -i arch
                "io.balena.architecture": "rpi",
                "io.balena.architecture": "rpi",
        "Architecture": "amd64"

pi@raspberrypi:~/docker $ docker image inspect balenalib/rpi-raspbian:latest | grep -i arch
                "io.balena.architecture": "rpi",
                "io.balena.architecture": "rpi",
        "Architecture": "amd64",

 

 

jonnymo
Novice
44 Views

I tried the following with better results:

  docker buildx build --platform=linux/arm/v7 . -t openvino-rpi

pi@raspberrypi:~/docker $ docker buildx build --platform=linux/arm/v7 . -t openvino-rpi 
[+] Building 988.8s (11/11) FINISHED                                            
 => [internal] load build definition from Dockerfile                       0.3s
 => => transferring dockerfile: 3.35kB                                     0.1s
 => [internal] load .dockerignore                                          0.1s
 => => transferring context: 2B                                            0.0s
 => [internal] load metadata for docker.io/balenalib/rpi-raspbian:latest   2.0s
 => [1/7] FROM docker.io/balenalib/rpi-raspbian:latest@sha256:566d3d4aec  51.9s
 => => resolve docker.io/balenalib/rpi-raspbian:latest@sha256:566d3d4aec9  0.0s
 => => sha256:bbf526ff29798ef56e20c818b8fe7e0f5d5fc90af0d 4.87kB / 4.87kB  0.0s
 => => sha256:566d3d4aec9b3cef82ddc79a5d98cbf1959cae17d28 1.78kB / 1.78kB  0.0s
 => => sha256:20e06662a7a272b3f858829f8818f2d6b625c7ff 38.45MB / 38.45MB  23.0s
 => => sha256:bbe977187d35e14e35f03180c4454e5c9f478f8029492e1 304B / 304B  0.8s
 => => sha256:1c62e9e51efea3549a93dc53e4e2dc4bd9458a2adcd5ca3 254B / 254B  0.6s
 => => sha256:ab4813588625cdf2dcda2120b677ba4b51f92fccf343d94 907B / 907B  1.0s
 => => sha256:70c0b6627ae89014d108c15c5294ec61d905c719698b308 176B / 176B  1.1s
 => => sha256:0483f1a5a01b2281a03e51d86ca0a935dac0a66fb8eb899 412B / 412B  1.3s
 => => sha256:8cc1424b602b64448ae4963be5840ee01b6a3181 15.34MB / 15.34MB  13.4s
 => => extracting sha256:20e06662a7a272b3f858829f8818f2d6b625c7ff45870cc  10.3s
 => => extracting sha256:bbe977187d35e14e35f03180c4454e5c9f478f8029492e10  0.0s
 => => extracting sha256:1c62e9e51efea3549a93dc53e4e2dc4bd9458a2adcd5ca39  0.0s
 => => extracting sha256:ab4813588625cdf2dcda2120b677ba4b51f92fccf343d947  0.0s
 => => extracting sha256:70c0b6627ae89014d108c15c5294ec61d905c719698b308a  0.0s
 => => extracting sha256:0483f1a5a01b2281a03e51d86ca0a935dac0a66fb8eb8998  0.0s
 => => extracting sha256:8cc1424b602b64448ae4963be5840ee01b6a3181b39ddeee  1.2s
 => [2/7] RUN apt-get update && apt-get install -y --no-install-recomme  678.8s
 => [3/7] RUN pip3 install --no-cache-dir setuptools &&     pip3 instal  136.6s
 => [4/7] RUN mkdir -p /opt/intel/openvino && cd /opt/intel/openvino &&   41.8s
 => [5/7] RUN sudo usermod -a -G users "$(whoami)" &&    /bin/bash -c "so  2.1s
 => [6/7] RUN echo "source /opt/intel/openvino/bin/setupvars.sh" >> ~/.b  23.3s
 => [7/7] RUN echo "import cv2 as cv\nnet = cv.dnn.readNet('person-vehicl  1.4s
 => exporting to image                                                    49.9s
 => => exporting layers                                                   49.8s
 => => writing image sha256:e67a6636f3d3536e496f235f906f6df3d1849675bb116  0.0s
 => => naming to docker.io/library/openvino-rpi                          

 

Arch looks like this:

pi@raspberrypi:~/docker $ docker image inspect openvino-rpi:latest | grep -i arch
                "io.balena.architecture": "rpi",
        "Architecture": "arm",
IntelSupport
Community Manager
21 Views

Hi Jon,

This thread will no longer be monitored since we have provided a solution. If you need any additional information from Intel, please submit a new question. 


Regards,

Aznie