-
Notifications
You must be signed in to change notification settings - Fork 1.3k
export SavedModel error #296
Comments
Same problem here, I was not able to successfully export a tensorflow servable. Can anyone help? |
Hi guys, I come across the same problem and try to solve this in another way. |
@Orpin Hi, have can I use tf.train.SessionRunHook. Is there any example, I saw your code, but still confused.. |
@CangHaiQingYue Hi, I found another solution and forgot to update the comment. You can use this piece of code before creating tf.saved_model.builder to unfinalize the graph |
is that possible to use this method defined in tensorflow with seq2seq? There is also something like _maybe_export in official repo Need to use the exported model in tf serving. |
Could you share the code snippet? |
You can read these two pages:https://github.com/Microsoft/samples-for-ai/blob/master/projects/StyleTransfer/StyleTransferTraining/src/train.py#L218 and microsoft/vs-tools-for-ai#16 |
I try to export seq2seq model to SavedModel protobuf for later inferencing with java language.
According to guides from tensorflow(https://www.tensorflow.org/api_docs/python/tf/saved_model/builder/SavedModelBuilder), we need to create a SavedModelBuilder, and then add meta graph to a session.
But I find that, the framework in tensorflow use MonitoredTrainingSession as the session , and it will finalize the graph, so we I call builder.add_meta_graph_and_variables in after_create_session(self, session, coord) function in hooks.py , it reports errors: "graph is finalized and cannot be modified"
And I try to add SavedModelBuilder in somewhere else, it does't have a session, the API can't be called. But when the session is created, the graph is already been finalized, and can't be changed anymore!
So can anyone help me how to export SavedModel for this framework?
The text was updated successfully, but these errors were encountered: