Ungraded Lab - Tensorflow Serving with Docker - docker run

Hi,
running docker in a Virtualbox Ubuntu image (docker run hello-world runs successfully) and docker images shoes:

REPOSITORY           TAG       IMAGE ID       CREATED         SIZE
tensorflow/serving   latest    3d0c9b293f81   5 weeks ago     459MB
hello-world          latest    feb5d9fea6a5   15 months ago   13.3kB

works.
Calling the tensorflow_serving container:

docker run --rm -p 8501:8501 \
  --mount type=bind,\
source=/tmp/tfserving/serving/tensorflow_serving/servables/tensorflow/testdata/saved_model_half_plus_two_cpu,\
target=/models/half_plus_two \
  -e MODEL_NAME=half_plus_two -t tensorflow/serving &

[1] 8044

Is resulting in this error message:

martin@pop-os:/tmp/tfserving$ /usr/bin/tf_serving_entrypoint.sh: line 3:     7 **Illegal instruction     (core dumped) tensorflow_model_server** --port=8500 --rest_api_port=8501 --model_name=${MODEL_NAME} --model_base_path=${MODEL_BASE_PATH}/${MODEL_NAME} "$@"

This is a showstopper for me . Does anybody know the reason?
Thank you

Please share the output of:

$ ls -lhR /tmp/tfserving/serving/tensorflow_serving/servables/tensorflow/testdata/saved_model_half_plus_two_cpu

The latest docker image of tensorflow/serving works on my linux machine (without virtualbox):

$ docker image ls | grep serving
tensorflow/serving            latest      3d0c9b293f81   5 weeks ago     459MB

After deploying:

$ curl -d '{"instances": [1.0, 2.0, 5.0]}' \
  -X POST http://localhost:8501/v1/models/half_plus_two:predict
{
    "predictions": [2.5, 3.0, 4.5
    ]

Hello, here the first steps:

martin@pop-os:~$ docker pull tensorflow/serving
Using default tag: latest
latest: Pulling from tensorflow/serving
Digest: sha256:e66c1866bf6596473d56beb3ef77bf7b8b00baa0e1e80c3c428ede31da8ae066
Status: Image is up to date for tensorflow/serving:latest
docker.io/tensorflow/serving:latest
martin@pop-os:~$ ls -lhR /tmp/tfserving/serving/tensorflow_serving/servables/tensorflow/testdata/saved_model_half_plus_two_cpu
ls: Zugriff auf '/tmp/tfserving/serving/tensorflow_serving/servables/tensorflow/testdata/saved_model_half_plus_two_cpu' nicht möglich: Datei oder Verzeichnis nicht gefunden
martin@pop-os:~$ mkdir -p /tmp/tfserving
martin@pop-os:~$ ls
Bilder     Downloads  Musik       Schreibtisch  Vorlagen
Dokumente  exchange   Öffentlich  Videos
martin@pop-os:~$ cd /
martin@pop-os:/$ ls
bin   dev  home  lib32  libx32      media  opt   root  sbin  sys  usr
boot  etc  lib   lib64  lost+found  mnt    proc  run   srv   tmp  var
martin@pop-os:/$ cd tmp
martin@pop-os:/tmp$ ls
gdm3-config-err-UObFQH
systemd-private-4be5d35ec99344f392837628d541f50e-chrony.service-GcldxL
systemd-private-4be5d35ec99344f392837628d541f50e-colord.service-FAZJRY
systemd-private-4be5d35ec99344f392837628d541f50e-dbus-broker.service-f11lEk
systemd-private-4be5d35ec99344f392837628d541f50e-ModemManager.service-CCSgTR
systemd-private-4be5d35ec99344f392837628d541f50e-switcheroo-control.service-NOkCfd
systemd-private-4be5d35ec99344f392837628d541f50e-systemd-logind.service-8tThdD
systemd-private-4be5d35ec99344f392837628d541f50e-systemd-resolved.service-bSoJW3
systemd-private-4be5d35ec99344f392837628d541f50e-upower.service-5BSkJo
tfserving
tracker-extract-3-files.1000
tracker-extract-3-files.111
martin@pop-os:/tmp$ cd tfserving
martin@pop-os:/tmp/tfserving$ git clone https://github.com/tensorflow/serving
Klone nach 'serving' …
remote: Enumerating objects: 32411, done.
remote: Counting objects: 100% (206/206), done.
remote: Compressing objects: 100% (119/119), done.
remote: Total 32411 (delta 126), reused 121 (delta 80), pack-reused 32205
Empfange Objekte: 100% (32411/32411), 16.76 MiB | 5.52 MiB/s, fertig.
Löse Unterschiede auf: 100% (26080/26080), fertig.
martin@pop-os:/tmp/tfserving$ docker run --rm -p 8501:8501 \
  --mount type=bind,\
source=/tmp/tfserving/serving/tensorflow_serving/servables/tensorflow/testdata/saved_model_half_plus_two_cpu,\
target=/models/half_plus_two \
  -e MODEL_NAME=half_plus_two -t tensorflow/serving &
[1] 5408
martin@pop-os:/tmp/tfserving$ /usr/bin/tf_serving_entrypoint.sh: line 3:     8 Illegal instruction     (core dumped) tensorflow_model_server --port=8500 --rest_api_port=8501 --model_name=${MODEL_NAME} --model_base_path=${MODEL_BASE_PATH}/${MODEL_NAME} "$@"

From :
martin@pop-os:/tmp/tfserving$ ls -lhR /tmp/tfserving/serving/tensorflow_serving/servables/tensorflow/testdata/saved_model_half_plus_two_cpu
I get:
/tmp/tfserving/serving/tensorflow_serving/servables/tensorflow/testdata/saved_model_half_plus_two_cpu:
insgesamt 4,0K
drwxrwxr-x 4 martin martin 4,0K Jan  5 14:16 00000123

/tmp/tfserving/serving/tensorflow_serving/servables/tensorflow/testdata/saved_model_half_plus_two_cpu/00000123:
insgesamt 20K
drwxrwxr-x 2 martin martin 4,0K Jan  5 14:16 assets
-rw-rw-r-- 1 martin martin  12K Jan  5 14:16 saved_model.pb
drwxrwxr-x 2 martin martin 4,0K Jan  5 14:16 variables

/tmp/tfserving/serving/tensorflow_serving/servables/tensorflow/testdata/saved_model_half_plus_two_cpu/00000123/assets:
insgesamt 4,0K
-rw-rw-r-- 1 martin martin 19 Jan  5 14:16 foo.txt

/tmp/tfserving/serving/tensorflow_serving/servables/tensorflow/testdata/saved_model_half_plus_two_cpu/00000123/variables:
insgesamt 8,0K
-rw-rw-r-- 1 martin martin  20 Jan  5 14:16 variables.data-00000-of-00001
-rw-rw-r-- 1 martin martin 172 Jan  5 14:16 variables.index

From:
artin@pop-os:/tmp/tfserving$  docker image ls | grep serving
tensorflow/serving   latest    3d0c9b293f81   6 weeks ago     459MB

The next one is a refused connection, while trying this on my company PC (Firewall?). So I will do the Lab on my private PC directly under Pop!OS

You will get feedback, thanks

Finally it works on my private PC directly in Ubuntu.
──(martin㉿pop-os)-[~]
└─$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c4a8300b5bb5 tensorflow/serving “/usr/bin/tf_serving…” 5 minutes ago Up 5 minutes 8500/tcp, 0.0.0.0:8501->8501/tcp, :::8501->8501/tcp brave_meninsky

So we can close the post, thank you