adanet
adanet copied to clipboard
Saving model fails
Since the example code did not actually save the model, I added the code below to do so. However, it fails with "TypeError: Value passed to parameter 'dense_defaults' has DataType float64 not in list of allowed values: float32, int64, string". The available "allowed values" for x_in fail with various other issues. How does one actually save the model to SavedModel format?
x_in = tf.feature_column.numeric_column(FEATURES_KEY, dtype=tf.float64)
feature_columns = [x_in]
feature_spec = tf.feature_column.make_parse_example_spec(feature_columns)
export_input_fn = tf.estimator.export.build_parsing_serving_input_receiver_fn(feature_spec)
print("Exporting model")
estimator.export_saved_model(export_dir, export_input_fn)
looks like the problem is your numeric_column has dtype tf.float64. Does it work if you change it to tf.float32?
I tried all the listed types. Using tf.float32 gives the error: ValueError: Input 0 of node wrapped_x_4 was passed float from wrapped_x:0 incompatible with expected double.
Try upgrading to adanet=0.5.0 and training from scratch with a new model_dir. Let me know if that works.