error with image serving recipe

using the custom recipe

https://github.com/explosion/prodigy-recipes/blob/master/image/tf_odapi/image_tf_serving.py

I got

"TypeError: get_label_map_dict() got an unexpected keyword argument 'label_map_path'"

command

prodigy image.servingmodel np_ook ./data/ <MY_IP> 9996 classes.txt -F /prodigy-recipes/image/tf_odapi/image_tf_serving.py

This recipe was contributed by a user, and I don't know all the details of the TensorFlow object detection API. But from reading the code, it looks like the get_label_map_dict function is part of TensorFlow's object_detection package (see here). So maybe you're running an older version of it that doesn't support that argument? Maybe try upgrading the package and see what happens?

I verified that this recipe is for Tensorflow <2.1 not Tensorflow 2.1. I update few snippets of code and now I'm able to run it, but I received an error during connection.

So that I implemented my custom recipe with keas ... unfortunately keras is quite slow ....how to implement a sort of "lazy fetch"?

Glad you got it working!

Which part is it that's especially slow? The prediction?

yes the prediction

@venergiac hey I made the recipe like in summer 2019. So I guess the API changed quite a bit from then. In my post I have given a link to the fork of the models repository https://github.com/Abhijit-2592/models.
If you read through the post, I use TensorFlow serving for predictions because I wanted to separate the training and the prediction graph. It is recommended to run the predictions in a separate GPU for speed. But if you have limited hardware available, I have also given a link to a custom built TensorFlow serving with AVX2 enabled docker image which should run considerably faster in CPU than the generic serving image from the TF team. Here is the command to pull that optimized image for your convenience docker pull abhijit2592/tensorflow-serving-devel. And the TensorFlow 2.0+ I believe is slightly slower compared to the 1.X versions because of the eager execution thing. You can try to optimize it using tf.function decorator. But I suggest you use the TensorFlow 1.x versions for this API because, anyway the TensorFlow object detection API does not use any of the useful 2.0+ stuffs.