tobegit3hub / simple_tensorflow_serving

Generic and easy-to-use serving service for machine learning models
https://stfs.readthedocs.io
Apache License 2.0
757 stars 192 forks source link

Model does not work , output is alway the same! not change #29

Closed Johnson-yue closed 6 years ago

Johnson-yue commented 6 years ago

Hi, I update your docker image and test my model which saved by SavedModel function. my model just is resnet_50 for classification, when I saved model as SavedModel format, the result did not change whether I changed any input picture ???

My Model have problem? what is wrong with my model or some reason?

Here is my saved model code : image

image

First, I build a resnet_50 compute graph , and then I reload graph and restore weights from checkpoint. Finally, I use tf.saved_model to save and everything is ok. I have no error or trouble.

I write client code for it , here: image In client code , first I read a image into numpy.array, then convert data of image to [1, 64, 64 ,3] dtype=float32, and convert numpy to list .
Finally, send a requests like code and show all result.

the result is always is: image

image

tobegit3hub commented 6 years ago

It seems to be the problem of the model. Can you try run inference in your python script? For example, you can load the checkpoint and run sess.run() with your test data and print the result.

Johnson-yue commented 6 years ago

@tobegit3hub thanks for your reply, it is my mistakes. I check the input data. it is the same. I think the reason is opencv2 and opencv3 difference!. When I use opencv3 python api, the result is correct! Thank you

tobegit3hub commented 6 years ago

You are welcome. Thanks for your report 👍