tensorflow / serving

A flexible, high-performance serving system for machine learning models

Home Page:https://www.tensorflow.org/serving

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Could not find a version that satisfies the requirement tensorflow

kevinashaw opened this issue · comments

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04):
    • MacOS 12.2 (21D49)
    • Python 3.10.9
  • TensorFlow Serving installed from (source or binary):
    • pip install tensorflow-macos==2.9.2
    • pip install tensorflow-serving-api==2.9.2
  • TensorFlow Serving version: Unable to install

Describe the problem

Describe the problem clearly here. Be sure to convey here why it's a bug in

The following command causes an installation error.

% pip install tensorflow-serving-api==2.9.2
Collecting tensorflow-serving-api==2.9.2
  Using cached tensorflow_serving_api-2.9.2-py2.py3-none-any.whl (37 kB)
Requirement already satisfied: protobuf>=3.6.0 in /Users/kevin/miniconda3/envs/env-3.10/lib/python3.10/site-packages (from tensorflow-serving-api==2.9.2) (3.19.6)
ERROR: Could not find a version that satisfies the requirement tensorflow<3,>=2.9.2 (from tensorflow-serving-api) (from versions: none)
ERROR: No matching distribution found for tensorflow<3,>=2.9.2

Exact Steps to Reproduce

Please include all steps necessary for someone to reproduce this issue on their
own machine. If not, skip this section.

Here is the installation sequence:

% pip install tensorflow-macos==2.9.2
Collecting tensorflow-macos==2.9.2
  Using cached tensorflow_macos-2.9.2-cp310-cp310-macosx_11_0_arm64.whl (200.6 MB)
Requirement already satisfied: numpy>=1.20 in /Users/user/lib/python3.10/site-packages (from tensorflow-macos==2.9.2) (1.23.5)
Collecting protobuf<3.20,>=3.9.2
  Using cached protobuf-3.19.6-py2.py3-none-any.whl (162 kB)
Requirement already satisfied: packaging in /Users/user/lib/python3.10/site-packages (from tensorflow-macos==2.9.2) (22.0)
Collecting astunparse>=1.6.0
  Using cached astunparse-1.6.3-py2.py3-none-any.whl (12 kB)
Requirement already satisfied: six>=1.12.0 in /Users/kevin/user/lib/python3.10/site-packages (from tensorflow-macos==2.9.2) (1.16.0)
Collecting h5py>=2.9.0
  Using cached h5py-3.8.0-cp310-cp310-macosx_11_0_arm64.whl (2.6 MB)
Collecting libclang>=13.0.0
  Using cached libclang-15.0.6.1-py2.py3-none-any.whl
Collecting keras<2.10.0,>=2.9.0rc0
  Using cached keras-2.9.0-py2.py3-none-any.whl (1.6 MB)
Collecting google-pasta>=0.1.1
  Using cached google_pasta-0.2.0-py3-none-any.whl (57 kB)
Collecting tensorboard<2.10,>=2.9
  Using cached tensorboard-2.9.1-py3-none-any.whl (5.8 MB)
Collecting keras-preprocessing>=1.1.1
  Using cached Keras_Preprocessing-1.1.2-py2.py3-none-any.whl (42 kB)
Collecting termcolor>=1.1.0
  Using cached termcolor-2.2.0-py3-none-any.whl (6.6 kB)
Collecting gast<=0.4.0,>=0.2.1
  Using cached gast-0.4.0-py3-none-any.whl (9.8 kB)
Collecting typing-extensions>=3.6.6
  Using cached typing_extensions-4.4.0-py3-none-any.whl (26 kB)
Collecting absl-py>=1.0.0
  Using cached absl_py-1.4.0-py3-none-any.whl (126 kB)
Requirement already satisfied: setuptools in /Users/user/lib/python3.10/site-packages (from tensorflow-macos==2.9.2) (65.6.3)
Collecting flatbuffers<2,>=1.12
  Using cached flatbuffers-1.12-py2.py3-none-any.whl (15 kB)
Collecting wrapt>=1.11.0
  Using cached wrapt-1.14.1-cp310-cp310-macosx_11_0_arm64.whl (35 kB)
Requirement already satisfied: grpcio<2.0,>=1.24.3 in /Users/user/lib/python3.10/site-packages (from tensorflow-macos==2.9.2) (1.42.0)
Collecting tensorflow-estimator<2.10.0,>=2.9.0rc0
  Using cached tensorflow_estimator-2.9.0-py2.py3-none-any.whl (438 kB)
Collecting opt-einsum>=2.3.2
  Using cached opt_einsum-3.3.0-py3-none-any.whl (65 kB)
Requirement already satisfied: wheel<1.0,>=0.23.0 in /Users/user/lib/python3.10/site-packages (from astunparse>=1.6.0->tensorflow-macos==2.9.2) (0.37.1)
Collecting tensorboard-data-server<0.7.0,>=0.6.0
  Using cached tensorboard_data_server-0.6.1-py3-none-any.whl (2.4 kB)
Collecting markdown>=2.6.8
  Using cached Markdown-3.4.1-py3-none-any.whl (93 kB)
Collecting requests<3,>=2.21.0
  Using cached requests-2.28.2-py3-none-any.whl (62 kB)
Collecting werkzeug>=1.0.1
  Using cached Werkzeug-2.2.2-py3-none-any.whl (232 kB)
Collecting google-auth-oauthlib<0.5,>=0.4.1
  Using cached google_auth_oauthlib-0.4.6-py2.py3-none-any.whl (18 kB)
Collecting tensorboard-plugin-wit>=1.6.0
  Using cached tensorboard_plugin_wit-1.8.1-py3-none-any.whl (781 kB)
Collecting google-auth<3,>=1.6.3
  Using cached google_auth-2.16.0-py2.py3-none-any.whl (177 kB)
Collecting cachetools<6.0,>=2.0.0
  Using cached cachetools-5.3.0-py3-none-any.whl (9.3 kB)
Collecting pyasn1-modules>=0.2.1
  Using cached pyasn1_modules-0.2.8-py2.py3-none-any.whl (155 kB)
Collecting rsa<5,>=3.1.4
  Using cached rsa-4.9-py3-none-any.whl (34 kB)
Collecting requests-oauthlib>=0.7.0
  Using cached requests_oauthlib-1.3.1-py2.py3-none-any.whl (23 kB)
Requirement already satisfied: idna<4,>=2.5 in /Users/user/lib/python3.10/site-packages (from requests<3,>=2.21.0->tensorboard<2.10,>=2.9->tensorflow-macos==2.9.2) (3.4)
Requirement already satisfied: certifi>=2017.4.17 in /Users/user/lib/python3.10/site-packages (from requests<3,>=2.21.0->tensorboard<2.10,>=2.9->tensorflow-macos==2.9.2) (2022.12.7)
Collecting charset-normalizer<4,>=2
  Using cached charset_normalizer-3.0.1-cp310-cp310-macosx_11_0_arm64.whl (122 kB)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /Users/user/lib/python3.10/site-packages (from requests<3,>=2.21.0->tensorboard<2.10,>=2.9->tensorflow-macos==2.9.2) (1.26.14)
Collecting MarkupSafe>=2.1.1
  Using cached MarkupSafe-2.1.2-cp310-cp310-macosx_10_9_universal2.whl (17 kB)
Collecting pyasn1<0.5.0,>=0.4.6
  Using cached pyasn1-0.4.8-py2.py3-none-any.whl (77 kB)
Collecting oauthlib>=3.0.0
  Using cached oauthlib-3.2.2-py3-none-any.whl (151 kB)
Installing collected packages: tensorboard-plugin-wit, pyasn1, libclang, keras, flatbuffers, charset-normalizer, wrapt, typing-extensions, termcolor, tensorflow-estimator, tensorboard-data-server, rsa, requests, pyasn1-modules, protobuf, opt-einsum, oauthlib, MarkupSafe, markdown, keras-preprocessing, h5py, google-pasta, gast, cachetools, astunparse, absl-py, werkzeug, requests-oauthlib, google-auth, google-auth-oauthlib, tensorboard, tensorflow-macos
Successfully installed MarkupSafe-2.1.2 absl-py-1.4.0 astunparse-1.6.3 cachetools-5.3.0 charset-normalizer-3.0.1 flatbuffers-1.12 gast-0.4.0 google-auth-2.16.0 google-auth-oauthlib-0.4.6 google-pasta-0.2.0 h5py-3.8.0 keras-2.9.0 keras-preprocessing-1.1.2 libclang-15.0.6.1 markdown-3.4.1 oauthlib-3.2.2 opt-einsum-3.3.0 protobuf-3.19.6 pyasn1-0.4.8 pyasn1-modules-0.2.8 requests-2.28.2 requests-oauthlib-1.3.1 rsa-4.9 tensorboard-2.9.1 tensorboard-data-server-0.6.1 tensorboard-plugin-wit-1.8.1 tensorflow-estimator-2.9.0 tensorflow-macos-2.9.2 termcolor-2.2.0 typing-extensions-4.4.0 werkzeug-2.2.2 wrapt-1.14.1

(my-env) % pip install tensorflow-serving-api==2.9.2
Collecting tensorflow-serving-api==2.9.2
  Using cached tensorflow_serving_api-2.9.2-py2.py3-none-any.whl (37 kB)
Requirement already satisfied: protobuf>=3.6.0 in /Users/user/lib/python3.10/site-packages (from tensorflow-serving-api==2.9.2) (3.19.6)
ERROR: Could not find a version that satisfies the requirement tensorflow<3,>=2.9.2 (from tensorflow-serving-api) (from versions: none)
ERROR: No matching distribution found for tensorflow<3,>=2.9.2

I'm not sure what else to add here.

@kevinashaw,

We are currently working Apple Mac M1 support, and will have an update in the fairly near future. In the meantime, some users have reported success with custom builds. Other options include using a VM. We understand that neither of those is ideal.

We don’t have a firm ETA yet. As similar issue is already tracked at #1816, requesting you to follow #1816 and TF Forum thread for updates and close this issue.

Thank you!

@singhniraj08 Thank you for the response. We have moved our development work to Ubuntu instances for now.
We can close this. Thanks. -K

@singhniraj08 I need to do some TFS development work from a MacOS platform. Any updates?

Here is the latest report from pip:

(arrhythmia) user@my-computer arrhythmia-v1 % pip install tensorflow-macos==2.12.0       
Requirement already satisfied: tensorflow-macos==2.12.0 in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (2.12.0)
Requirement already satisfied: setuptools in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from tensorflow-macos==2.12.0) (65.6.3)
Requirement already satisfied: h5py>=2.9.0 in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from tensorflow-macos==2.12.0) (3.7.0)
Requirement already satisfied: flatbuffers>=2.0 in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from tensorflow-macos==2.12.0) (23.3.3)
Requirement already satisfied: jax>=0.3.15 in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from tensorflow-macos==2.12.0) (0.4.8)
Requirement already satisfied: keras<2.13,>=2.12.0 in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from tensorflow-macos==2.12.0) (2.12.0)
Requirement already satisfied: wrapt<1.15,>=1.11.0 in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from tensorflow-macos==2.12.0) (1.14.1)
Requirement already satisfied: libclang>=13.0.0 in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from tensorflow-macos==2.12.0) (14.0.6)
Requirement already satisfied: termcolor>=1.1.0 in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from tensorflow-macos==2.12.0) (2.0.1)
Requirement already satisfied: opt-einsum>=2.3.2 in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from tensorflow-macos==2.12.0) (3.3.0)
Requirement already satisfied: grpcio<2.0,>=1.24.3 in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from tensorflow-macos==2.12.0) (1.49.1)
Requirement already satisfied: tensorboard<2.13,>=2.12 in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from tensorflow-macos==2.12.0) (2.12.2)
Requirement already satisfied: tensorflow-estimator<2.13,>=2.12.0 in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from tensorflow-macos==2.12.0) (2.12.0)
Requirement already satisfied: gast<=0.4.0,>=0.2.1 in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from tensorflow-macos==2.12.0) (0.4.0)
Requirement already satisfied: absl-py>=1.0.0 in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from tensorflow-macos==2.12.0) (1.2.0)
Requirement already satisfied: packaging in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from tensorflow-macos==2.12.0) (22.0)
Requirement already satisfied: astunparse>=1.6.0 in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from tensorflow-macos==2.12.0) (1.6.3)
Requirement already satisfied: numpy<1.24,>=1.22 in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from tensorflow-macos==2.12.0) (1.23.3)
Requirement already satisfied: six>=1.12.0 in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from tensorflow-macos==2.12.0) (1.16.0)
Requirement already satisfied: typing-extensions>=3.6.6 in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from tensorflow-macos==2.12.0) (4.3.0)
Requirement already satisfied: google-pasta>=0.1.1 in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from tensorflow-macos==2.12.0) (0.2.0)
Requirement already satisfied: protobuf!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<5.0.0dev,>=3.20.3 in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from tensorflow-macos==2.12.0) (4.22.3)
Requirement already satisfied: wheel<1.0,>=0.23.0 in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from astunparse>=1.6.0->tensorflow-macos==2.12.0) (0.37.1)
Requirement already satisfied: ml-dtypes>=0.0.3 in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from jax>=0.3.15->tensorflow-macos==2.12.0) (0.1.0)
Requirement already satisfied: scipy>=1.7 in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from jax>=0.3.15->tensorflow-macos==2.12.0) (1.9.1)
Requirement already satisfied: markdown>=2.6.8 in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from tensorboard<2.13,>=2.12->tensorflow-macos==2.12.0) (3.4.1)
Requirement already satisfied: tensorboard-data-server<0.8.0,>=0.7.0 in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from tensorboard<2.13,>=2.12->tensorflow-macos==2.12.0) (0.7.0)
Requirement already satisfied: requests<3,>=2.21.0 in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from tensorboard<2.13,>=2.12->tensorflow-macos==2.12.0) (2.28.1)
Requirement already satisfied: google-auth<3,>=1.6.3 in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from tensorboard<2.13,>=2.12->tensorflow-macos==2.12.0) (2.17.3)
Requirement already satisfied: google-auth-oauthlib<1.1,>=0.5 in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from tensorboard<2.13,>=2.12->tensorflow-macos==2.12.0) (1.0.0)
Requirement already satisfied: werkzeug>=1.0.1 in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from tensorboard<2.13,>=2.12->tensorflow-macos==2.12.0) (2.2.2)
Requirement already satisfied: tensorboard-plugin-wit>=1.6.0 in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from tensorboard<2.13,>=2.12->tensorflow-macos==2.12.0) (1.8.1)
Requirement already satisfied: pyasn1-modules>=0.2.1 in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from google-auth<3,>=1.6.3->tensorboard<2.13,>=2.12->tensorflow-macos==2.12.0) (0.2.8)
Requirement already satisfied: cachetools<6.0,>=2.0.0 in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from google-auth<3,>=1.6.3->tensorboard<2.13,>=2.12->tensorflow-macos==2.12.0) (5.2.0)
Requirement already satisfied: rsa<5,>=3.1.4 in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from google-auth<3,>=1.6.3->tensorboard<2.13,>=2.12->tensorflow-macos==2.12.0) (4.9)
Requirement already satisfied: requests-oauthlib>=0.7.0 in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from google-auth-oauthlib<1.1,>=0.5->tensorboard<2.13,>=2.12->tensorflow-macos==2.12.0) (1.3.1)
Requirement already satisfied: importlib-metadata>=4.4 in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from markdown>=2.6.8->tensorboard<2.13,>=2.12->tensorflow-macos==2.12.0) (4.12.0)
Requirement already satisfied: certifi>=2017.4.17 in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from requests<3,>=2.21.0->tensorboard<2.13,>=2.12->tensorflow-macos==2.12.0) (2022.12.7)
Requirement already satisfied: idna<4,>=2.5 in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from requests<3,>=2.21.0->tensorboard<2.13,>=2.12->tensorflow-macos==2.12.0) (3.4)
Requirement already satisfied: charset-normalizer<3,>=2 in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from requests<3,>=2.21.0->tensorboard<2.13,>=2.12->tensorflow-macos==2.12.0) (2.1.1)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from requests<3,>=2.21.0->tensorboard<2.13,>=2.12->tensorflow-macos==2.12.0) (1.26.14)
Requirement already satisfied: MarkupSafe>=2.1.1 in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from werkzeug>=1.0.1->tensorboard<2.13,>=2.12->tensorflow-macos==2.12.0) (2.1.1)
Requirement already satisfied: zipp>=0.5 in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from importlib-metadata>=4.4->markdown>=2.6.8->tensorboard<2.13,>=2.12->tensorflow-macos==2.12.0) (3.8.1)
Requirement already satisfied: pyasn1<0.5.0,>=0.4.6 in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from pyasn1-modules>=0.2.1->google-auth<3,>=1.6.3->tensorboard<2.13,>=2.12->tensorflow-macos==2.12.0) (0.4.8)
Requirement already satisfied: oauthlib>=3.0.0 in /Users/kevin/miniconda3/envs/arrhythmia/lib/python3.9/site-packages (from requests-oauthlib>=0.7.0->google-auth-oauthlib<1.1,>=0.5->tensorboard<2.13,>=2.12->tensorflow-macos==2.12.0) (3.2.1)
(arrhythmia) user@my-computer arrhythmia-v1 % pip install tensorflow-serving-api==2.12.0
Collecting tensorflow-serving-api==2.12.0
  Using cached tensorflow_serving_api-2.12.0-py2.py3-none-any.whl (26 kB)
ERROR: Could not find a version that satisfies the requirement tensorflow<3,>=2.12.0 (from tensorflow-serving-api) (from versions: none)
ERROR: No matching distribution found for tensorflow<3,>=2.12.0
(arrhythmia) user@my-computer arrhythmia-v1 % 

I'm guessing the problem is due to tensorflow-macos being installed, but the pip install script is looking for tensorflow and therefore can't find it.

@kevinashaw,

Does the custom build mentioned in similar issue helps you? I understand that it's not ideal but we are still working on introducing Apple Mac M1 support. I would request you to follow and +1 #1816 issue and close this duplicate issue. Thanks!

@singhniraj08 It seems there is a misunderstanding of the needs here. I don't need to run the TFS model-server on my local machine. We have a cluster for that. I need to run the client code that makes the gRPC calls on TFS with my local machine. That's why I need to import tensorflow-serving-api. The issue you reference provides a TFS ARM container to run the model server (I've used it before) and it does not solve the issue here.

I just need to be able to import a library, not run the full model-server.

BTW, it looks like this issue is two years old and its been 2.5 years since M1 systems were released. This issue does not seem to be getting a lot of love here.

@kevinashaw,

Tensorflow prediction APIs are defined as protobufs. Instead of loading Tensorflow and TF Serving dependency, you can replace them by generating the necessary tensorflow and tensorflow_serving protobuf python stubs. This avoids the need to pull in the entire (heavy) Tensorflow library on the client itself. You can refer this article to implement this. Plus, this will add in as a performance improvement.

Also, few users reported success with pip3 install --no-deps tensorflow-serving-api. Kindly let us know if this works for you, Thanks.

@singhniraj08 Thank you for the reference to the excellent article. I was able to follow the instructions and remove all tensorflow and tensorflow-serving-api import requirements for the prediction code. This is very helpful!

The recommendations to simplify the predict.proto file to the minimal required operations (i.e. Predict only) was key!

I created a shell script to help with the process (yes, it could be fancier, but I'm faster with cut-n-paste than I am with shell-script)

File: install_protos.sh

mkdir ~/my_repo/protos/tensorflow_serving
mkdir ~/my_repo/protos/tensorflow_serving/apis
cp ~/serving/tensorflow_serving/apis/model.proto              ~/my_repo/protos/tensorflow_serving/apis
cp ~/serving/tensorflow_serving/apis/predict.proto            ~/my_repo/protos/tensorflow_serving/apis
cp ~/serving/tensorflow_serving/apis/prediction_service.proto ~/my_repo/protos/tensorflow_serving/apis

mkdir ~/my_repo/protos/tensorflow
mkdir ~/my_repo/protos/tensorflow/core
mkdir ~/my_repo/protos/tensorflow/core/framework
cp ~/tensorflow/tensorflow/core/framework/resource_handle.proto ~/my_repo/protos/tensorflow/core/framework
cp ~/tensorflow/tensorflow/core/framework/tensor_shape.proto    ~/my_repo/protos/tensorflow/core/framework
cp ~/tensorflow/tensorflow/core/framework/tensor.proto          ~/my_repo/protos/tensorflow/core/framework
cp ~/tensorflow/tensorflow/core/framework/types.proto           ~/my_repo/protos/tensorflow/core/framework

Are you satisfied with the resolution of your issue?
Yes
No