-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use tf.contrib.image.rotate in place of lambda:tf.py_func(random_rotate_image, [image], tf.uint8) #789
Comments
Having the same issue, waiting for a solution. |
I think you can remove this line and re-train the model. Because based on the training parameters that the author @davidsandberg provided in this train example, '--random_rotate' is not set and thus this function will not be used in training. |
We don't have this issue with facenet in TF-Serving. We used it for 4 months without a problem. |
what I did is: download the pre-trained model, export it to TF serverable using the code provided in this thread, and got the same error as described here by @Dr-Champ |
I used the SavedModelBuilder to generate the servable model. Load the model, get the 3 tensor (input, embeddings y phase_train), create the I don't have the code anymore, but this script took me no more than 30 lines of code. |
Hi, @xolott I found your script which you used for generate the servable, but still got the same issue. However, I also found an older version '20170512-110547' instead of the latest one '20180402-114759' on the page . The old one can be run on TF-Serving. Anyway, I will still remove the 'py_func' and re-train the model. will let you know once i have done. |
Hi @FortiLeiZhang, I was able to create the servable. Then when I was trying to invoke the tensorfow_model_server to specify the port, it threw me the 'PyFunc' error. I then went back and commented the 'tf.py_func()' line in facenet.py, created the servable again and ran the model server. It still threw me the 'PyFunc' error which was quite weird. You mentioned that you tried an older version, viz. '20170512-110547' and there was no problem in serving the model. But, using '20180402-114759' throws this 'PyFunc' error. Now, it got me thinking, is it because the older version doesn't have py_func() used anywhere (while creating the pre-trained .pb file) but the latest version does? That's why even if we remove the py_func() line from facenet.py it still throws this error? Can you kindly tell me where you found the '20170512-110547' file? I don't seem to be able to find it on the page. |
Hi, @tamaghnadutta In the facenet package, you can find in "download_and_extract.py". Read the code, then you will get the download link. |
a quick update. I removed all the lines image = tf.cond(get_control_flag(control[0], RANDOM_ROTATE),
lambda:tf.py_func(random_rotate_image, [image], tf.uint8),
lambda:tf.identity(image)) and re-train the model. The first checkpoint is serverable without the py_func issue. |
@FortiLeiZhang can you share your retrained weights without py_func preprocessing layer please ? |
Hello, where is this update? I can't find it |
I delete py_ func, and use training to copy the weight, the problem has been solved, thank you |
In the graph we are using
lambda:tf.py_func(random_rotate_image, [image], tf.uint8)
inside
create_input_pipeline
This causes problem while using tensor flow serving as python layers are not supported on TensorFlow serving.
Can we convert this to a TensorFlow operations ? Something like tf.contrib.image.rotate ? What could be the downside ? @davidsandberg @xolott, @Cecilwang, @scotthong Please comment.
This issue would also get resolved.
The text was updated successfully, but these errors were encountered: