Closed ayushch3 closed 4 years ago
This question is better asked on StackOverflow since it is not a bug or feature request. There is also a larger community that reads questions there.
@rmothukuru Its actually a bug because the code works as it is when input is passed to the function, however adding the tf.function wrapper causes the code to fail, my guess is its something to do with running this in graph mode. I need to be able to export that function for tf-serving but this has remained a blocker
@ayushch3,
If the problem is with tf.function
wrapper, then it is more of a Tensorflow
issue than a Serving
Issue. Please raise an Issue in Tensorflow Repository. Thanks!
@rmothukuru I was able to resolve the issue with tf.function wrapper, once the model was exported, its still not compatible with tf serving:
@ayushch3, Can you please confirm if we can close this issue as the issue is resolved and as the subsequent error is being tracked in #1707. Thanks!
@ayushch3 Can you please respond to the above comment. Thanks!
System information
Describe the current behavior I ported n gram computation for truecasing to tf-2.0 and it works fine when I run the function as standalone but fails when I try to wrap the function with tf.function. There is a get_score function that creates unigram/bigram combinations. When the function runs standalone with string tensor as input, everything works as expected
Describe the expected behavior
The tf.function wrapper is needed so that the model can be exported to run with tf.serving. The code functions correctly when its provided an input. But the code fails with the error attached when tf.function wrapper is added
Standalone code to reproduce the issue
Other info / logs Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.
The code can be accessed here to look at the entire source code: https://github.com/ayushch3/truecaser_tf
The weights file can be accessed here: https://drive.google.com/file/d/1DpmsDYm-gzcwXCJT4sMCUXmtHGSxKiIR/view?usp=sharing