opened
haifengkao
username_0
**System information**
- Have I written custom code (as opposed to using a stock example script provided in TensorFlow): NO
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): OSX 10.15.5
- Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device:
- TensorFlow installed from (source or binary): binary
- TensorFlow version (use command below): v2.2.0-rc4-8-g2b96f3662b 2.2.0
- Python version: 3.7.4
- Bazel version (if compiling from source):
- GCC/Compiler version (if compiling from source):
- CUDA/cuDNN version: CPU only
- GPU model and memory: CPU only

**Describe the current behavior**
![截圖 2020-07-04 上午10 29 16](https://user-images.githubusercontent.com/4080524/86503500-3a340380-bde1-11ea-823c-66f2d55f715c.jpg)

**Describe the expected behavior**
should save the model successfully

**Standalone code to reproduce the issue**
```py
import tensorflow as tf
from tensorflow import feature_column
tf.compat.v1.disable_eager_execution()

# Define categorical colunm for our text feature, which is preprocessed into sequence of tokens
text_column = feature_column.sequence_categorical_column_with_vocabulary_list(key='text', vocabulary_list=list(['asd', 'asdf']))

max_length = 6
sequence_feature_layer_inputs = {}
sequence_feature_layer_inputs['text'] = tf.keras.Input(
    shape=(max_length,), name='text', dtype=tf.string)

text_embedding = feature_column.shared_embeddings([text_column], dimension=64)

# below is ok to save
# text_embedding = feature_column.embedding_column(text_column, dimension=8)

# Define SequenceFeatures layer to pass feature_columns into Keras model
sequence_feature_layer = tf.keras.experimental.SequenceFeatures(text_embedding)

# note here that SequenceFeatures layer produce tuple of two tensors as output. We need just first to pass next.
sequence_feature_layer_outputs, _ = sequence_feature_layer(
    sequence_feature_layer_inputs)
x = tf.keras.layers.Conv1D(8, 4)(sequence_feature_layer_outputs)
x = tf.keras.layers.MaxPooling1D(2)(x)
x = tf.keras.layers.Dense(256, activation='relu')(x)
x = tf.keras.layers.Dropout(0.2)(x)
x = tf.keras.layers.GlobalAveragePooling1D()(x)
# This example supposes binary classification, as labels are 0 or 1
x = tf.keras.layers.Dense(1, activation='sigmoid')(x)

model = tf.keras.models.Model(
    inputs=[v for v in sequence_feature_layer_inputs.values()], outputs=x)

model.summary()

# This example supposes binary classification, as labels are 0 or 1
model.compile(optimizer='adam',
              loss='binary_crossentropy',
              metrics=['accuracy']
              #run_eagerly=True
              )

model.save('model.h5')
```
tf.feature_column.shared_embeddings cannot be saved
issue
created
Saduf2019
username_1
@username_0 
I am able to replicate the issue faced, please find the [gist here.](https://colab.research.google.com/gist/username_1/961444f26a7df634919fb5aad51a826c/untitled257.ipynb)
comment
created
haifengkao
username_0
Yes, I can replicate on my computer as well. I feel that the whole feature column stuff are underdeveloped. 
Will this issue be solved?
comment
created
davidcereal
username_2
Any updates on this? Been a while and issue persists for me as well.
comment
created
tanzhenyu
username_3
Use Keras Preprocessing Layers instead of feature columns
comment
created
davidcereal
username_2
I'm using the [TensorFlow Ranking ](https://github.com/tensorflow/ranking) library, which is dependent on feature_columns as input to transform the features into a format suitable for Learn to Rank modeling. Since feature_columns have not been deprecated, I would hope this bug would be fixed.
comment
created
tanzhenyu
username_3
@ramakumar1729 Has TFR's support for KPL been opened sourced?
comment
created
VikashPeddakota999
username_4
@username_2 have you been able to find a solution?
comment
created
davidcereal
username_2
@username_4, unfortunately not yet.
comment
created
saikumarchalla
username_5
Was able to reproduce the issue in TF 2.5 version. Please find the gist [here](https://colab.research.google.com/gist/username_5/81555574e109c37d3c3a693869dd4f2b/untitled86.ipynb).Thanks!
comment
created
austinzh
username_6
If you only want to use shared_embedding, you checkout my gist, I do a copy of yours and modify it
https://colab.research.google.com/gist/username_6/361f7758b56dfa41b538c9b0c16feeb5/untitled86.ipynb
comment