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
How to export? #113
Comments
Hello @jinamshah , have you resolved this issue? If not, let me know and I can help debug. |
Hey @lukemelas I was able to resolve this issue. I wrote my own function to help me do this. |
Great! |
I believe this issue can be closed. |
I was also getting type mismatch errors while exporting model. TypeError: Tensors in list passed to 'values' of 'ConcatV2' Op have types [int32, int64] that don't all match. How did you resolve this issue? |
@ashgorithm |
@jinamshah would you be able to share your solution? I am having the same problem |
+1, please! |
|
Hey @AndrewPelton @hexiaoyupku I solved it :) Thank you to @jinamshah
|
Could someone please send me an example of http post request to this serving? |
I needed to know how to write the serving function to export the trained xlnet model.
I have this right now:
def serving_input_fn():
with tf.variable_scope("model"):
feature_spec = {
"input_ids": tf.FixedLenFeature([MAX_SEQ_LENGTH], tf.int64),
"input_mask": tf.FixedLenFeature([MAX_SEQ_LENGTH], tf.int64),
"segment_ids": tf.FixedLenFeature([MAX_SEQ_LENGTH], tf.int64),
"label_ids": tf.FixedLenFeature([], tf.int64),
}
serialized_tf_example = tf.placeholder(dtype=tf.string,
shape=[None],
name='input_example_tensor')
receiver_tensors = {'examples': serialized_tf_example}
features = tf.parse_example(serialized_tf_example, feature_spec)
return tf.estimator.export.ServingInputReceiver(features, receiver_tensors)
EXPORT_DIR = 'gs://{}/export/{}'.format(BUCKET, TASK_VERSION)
estimator._export_to_tpu = False # this is important
path = estimator.export_savedmodel(EXPORT_DIR, serving_input_fn)
This is throwing me errors.
Please note: this is the function that I used for Bert, and as I am no expert in tensorflow, I don't understand why it won't work.
It throws a type mismatch error
The text was updated successfully, but these errors were encountered: