Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
michabuehlmann opened this issue May 6, 2024 · 1 comment

Comments

@michabuehlmann
Copy link

michabuehlmann commented May 6, 2024

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:

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

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

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:

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:

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
@michabuehlmann
Copy link
Author

michabuehlmann commented May 22, 2024

I found a solution to my problem with the tensorflow docking image for macOS. I use the image "emacski/tensorflow-serving" with the platform "latest-linux_arm64". So i pull the image with the following command:

docker pull emacski/tensorflow-serving:latest-linux_arm64

And then you can use the image with the command:

docker run -it --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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant