ageron / ageron/handson-ml3

[QUESTION] "Installing and Starting TensorFlow Serving" in chapter 19

Open
#130 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
14.1k
Forks
5.3k
PR merge metrics
No merged PRs in 30d

Description

I try to use docker with tensorflow on my mac with m1 chip.
But I can't run the tenserflow server.

Do I have to get docker images in the ARM format for my mac? And if yes how do I get these images?

I try the following code from chapter 19:

```python
docker pull tensorflow/serving # downloads the latest TF Serving image

docker run -it --rm -v "/path/to/my_mnist_model:/models/my_mnist_model" \
-p 8500:8500 -p 8501:8501 -e MODEL_NAME=my_mnist_model tensorflow/serving
```
I use "Docker Desktop" for macOS.
I ran the command
```python
docker pull tensorflow/serving # downloads the latest TF Serving image
```
I get the images, but in the format "AMD64" as you can see in the following screenshot (from Docker Desktop):
image

When I run the code
```python
docker run -it --rm -v "/Users/michaelbuehlmann/Documents/GitHub/handson-ml31:/models/my_mnist_model" -p 8500:8500 -p 8501:8501 -e MODEL_NAME=my_mnist_model tensorflow/serving:latest
```
I get the following error message:

```stacktrace
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
/usr/bin/tf_serving_entrypoint.sh: line 3: 6 Illegal instruction tensorflow_model_server --port=8500 --rest_api_port=8501 --model_name=${MODEL_NAME} --model_base_path=${MODEL_BASE_PATH}/${MODEL_NAME} "$@"
```

I tried also the following:
```python
docker run -it --platform linux/arm64 --rm -v "/Users/michaelbuehlmann/Documents/GitHub/handson-ml31/my_mnist_model:/models/my_mnist_model" -p 8500:8500 -p 8501:8501 -e MODEL_NAME=my_mnist_model emacski/tensorflow-serving:latest-linux_arm64

```
**Versions:**
- OS: [MacOSX 14.4.1 Sonoma]
- Python: [3.11.0]
- TensorFlow: [2.12.0]
- Docker Desktop 4.29.0, Engine 26.0.0

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.