Closed deepanshuhardaha closed 1 month ago
I tried the BERT model downloaded from Kaggle on the same setup, and it is also failing with the same error
@deepanshuhardaha could you provide:
I used the following Kubernetes deployment YAML to load it
We'll further investigate this and get back to you
@deepanshuhardaha sorry for the delay, I had no issues running this model (both in TF .pb format and in IR format) on model server OpenVINO 2024.3 version (_openvino/modelserver:2024.3). Please note although you are not manually performing model conversion to run inference, model conversion is still performed automatically and “under the hood”. That being said like you said, you should be able to load the TF model as is without prior manual conversion. :)
Is it possible to try on the latest model_server image and see if the issue still occurs? It might also be due to improper model directory structure, make sure the you are following the particular directory structure rules as outlined in Prepare a Model Repository. Please also double check that. Hope this helps!
$ docker run -d --rm -v ${PWD}/models:/models -p 9000:9000 -p 8000:8000 openvino/model_server:2024.3 --model_path /models/tfmodel/ --model_name tfmodel --port 9000 --rest_port 8000 --log_level DEBUG
$ python predict.py
result: [[3.6116101e-06 1.4753303e-07 1.6656575e-01 7.8238291e-01 1.3858130e-10
4.9078122e-02 6.5075537e-06 6.5629570e-07 1.9615707e-03 7.1864463e-07]]
# contents of predict.py
import numpy as np
from ovmsclient import make_grpc_client
client = make_grpc_client("localhost:9000")
# generate input data
img = np.random.random((1, 28, 28)).astype(np.float32)
output = client.predict({"keras_tensor_5": img}, "tfmodel")
result_index = np.argmax(output[0])
print("result:", output)
Closing this, hope previous responses were sufficient to help you proceed. Feel free to reopen to ask additional questions.
OpenVINO Version
openvino/model_server:2024.2
Operating System
Ubuntu 18.04 (LTS)
Device used for inference
CPU
Framework
Keras (TensorFlow 2)
Model used
https://github.com/tensorflow/docs/blob/master/site/en/tutorials/quickstart/beginner.ipynb
Issue description
🐛 Describe the bug
Before deploying our production model, we attempted to load a basic TensorFlow model on Kubernetes using the OpenVino model server image. I followed the steps from the official TensorFlow notebook here to create a simple model. Afterward, I exported the model using the command:
probability_model.export( "<gcs_base_path>/3")
I was able to load and infer this exported model using vanilla TensorFlow Serving (used
tensorflow/serving:2.16.1
image).However, when deploying the same exported model on the OpenVino server, I encountered the following error
Environment
2.16.1
openvino/model_server:2024.2
n2-standard-8
Exported model
You can find the exported model here on Google Drive.
Container configuration snippet from deployment YAML
Is this a bug or am I missing something?
Thanks!
Step-by-step reproduction
No response
Relevant log output
No response
Issue submission checklist