Open DebbyDebStar opened 3 years ago
Thanks for reaching out.
Looks like you are using WIT with a model being served by TF serving, is that correct? It might be easier to debug by having the model run in the same process as WIT using custom prediction functions instead (https://pair-code.github.io/what-if-tool/learn/tutorials/custom-prediction/).
Does the data itself look correct when loaded into WIT (even though model predictions fail)? Are you able to share the dataset or does it contain sensitive information?
@jameswex Thank you for your fast reply.
I think the custom prediction function is a grate Idea. We will have a try and I will report if and how we solve the Problem.
The Data looks correct when loaded into WIT.
I create my data set with tf.data.experimental.make_batched_features_dataset, where numerical data are passed as float, categorical data as integer and vocabs as string. For serving, I create the spectrum feature manually, just like I did before when creating the dataset. Then I create a list of my features and pass them on to the model. The model trains successfully, but the categorical integers in the WIT generate an error.
I don't understand why the data is being passed as float according to the error message (At the end of my comment). The categorical columns of the data that are transferred to the WIT are also integers...
Has anyone already had the same mistake? Or can someone give me a tip where the error could be?
The _input_fn function that returns my dataset:
My function for Serving:
Create the feature columns:
However, the WIT then throws this error:
2021-05-12 11:18:29.680711: I tensorflow_serving/model_servers/server.cc:391] Exporting HTTP/REST API at:localhost:8501 ... 22021-05-12 11:18:42.060964: W external/org_tensorflow/tensorflow/core/framework/op_kernel.cc:1763] OP_REQUIRES failed at example_parsing_ops.cc:92 : Invalid argument: Name:, Key: Siblings_Spouses, Index: 0. Data types don't match. Data type: float but expected type: int64
32021-05-12 11:18:42.213860: W external/org_tensorflow/tensorflow/core/framework/op_kernel.cc:1763] OP_REQUIRES failed at example_parsing_ops.cc:92 : Invalid argument: Name:, Key: Siblings_Spouses, Index: 0. Data types don't match. Data type: float but expected type: int64
42021-05-12 11:18:42.389265: W external/org_tensorflow/tensorflow/core/framework/op_kernel.cc:1763] OP_REQUIRES failed at example_parsing_ops.cc:92 : Invalid argument: Name:, Key: Siblings_Spouses, Index: 0. Data types don't match. Data type: float but expected type: int64
52021-05-12 11:18:42.557218: W external/org_tensorflow/tensorflow/core/framework/op_kernel.cc:1763] OP_REQUIRES failed at example_parsing_ops.cc:92 : Invalid argument: Name:, Key: Parents_Children, Index: 0. Data types don't match. Data type: float but expected type: int64