Closed pokonski closed 5 years ago
Oh, that's interesting. I'll try to get to it during the weekend.
@emedvedev have you figured out what the problem was? I'm asking because I get the same error with a completely unrelated tensorflow model and this is the only place where I have found the same error message being mentioned :)
@emedvedev @pokonski @mz8i Did you find a solution? I faced exact same problem.
Hey @xvonabur, I just wrote a simple API in python myself instead of using Serving.
@pokonski Can you open source it? Or give me some hints how to implement it myself? Unfortunately I do not know python at all, so I'm stuck for now.
@xvonabur sure, I'll try to prepare an open-sourcable version since it currently contains work-related code.
@xvonabur I've prepared a simple working server here: https://github.com/pokonski/attention-ocr-api
I expect this might come in handy for more people since this issue is the first result in Google when searching for this error :)
WARNING This is not a production-ready code, Serving would be ideal but until it's solved by smarter people I am using the Python server.
@pokonski Thanks! I've managed to run it on Debian. I would like to use it in production, but saw your warning and now I'm curious what drawbacks has your solution?
It starts in a development mode by default which is slower and it probably doesn't handle thousands of requests well, but I guess that depends on the traffic you expect :)
I get the error as well. I am using the tensorflow/serving docker image. Has anybody found a way to export the model that is compatible with tensorflow/serving?
{ "error": "Tensor name: probability has no shape information " }
Hi,
Since months I'm stuck on the same problem using the curl command provided as exemple.
But today I tried to understand why this error { "error": "Tensor name: probability has no shape information " }
occur with the documentation here: https://www.tensorflow.org/serving/api_rest and I found an answer using this curl command instead:
curl -X POST --output - \
http://yourserver:9001/v1/models/aocr:predict \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-d '{
"signature_name": "serving_default",
"inputs":
{
"input": { "b64": "/9j/4AAQSkZJRgABAQAASABIAAD/4QBYRXhpZgAATU0AKgAAAAgAAgESAAMAAAABAAEAAIdpAAQAAAABAAAAJgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAOaADAAQAAAABAAAAHAAAAAD/7QA4UGhvdG9zaG9wIDMuMAA4QklNBAQAAAAAAAA4QklNBCUAAAAAABDUHYzZjwCyBOmACZjs+EJ+/8AAEQgAHAA5AwEiAAIRAQMRAf/EAB8AAAEFAQEBAQEBAAAAAAAAAAABAgM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IHvUP3nGalQYFMBwOCD/+qpd/1pgUcU/NAH//2Q==" }
}
}'
Yeah! I've the correct output:
{
"outputs": {
"probability": 0.999405,
"output": "TTXJHC"
}
}
I dont' know why we have to specify the input tensors in column format instead of using the row format.
Specifying input tensors in row format.
This format is similar to PredictRequest proto of gRPC API and the CMLE predict API. Use this format if all named input tensors have the same 0-th dimension. If they don't, use the columnar format described later below.
"instances": [ { "b64": "/9j/4AAk==" } ]
-->{ "error": "Tensor name: probability has no shape information " }
Specifying input tensors in column format.
Use this format to specify your input tensors, if individual named inputs do not have the same 0-th dimension or you want a more compact representation. This format is similar to the inputs field of the gRPC Predict request.
"inputs": { "input": { "b64": "/9j/4AAk==" } }
--> Working
@MariusMez oh, that's amazing! Thank you so much, I didn't have time to actually get around to this issue. Would you mind updating the README? It would be much appreciated :)
That is awesome :heart: @MariusMez
For given exported model:
Sending a following request to the serving REST API:
returns an error:
is it something that needs to be adjusted in the export function in aocr?