can't convert checkpoint to tflite model !
@TiantianZhang Could you please provide standalone code to replicate this issue and also let us know the TF version being used here. Please refer to [this](https://www.tensorflow.org/lite/models/convert) guide for tflite conversion.
Thank you! Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/62735">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/62735">No</a>
 > @TiantianZhang Could you please provide standalone code to replicate this issue and also let us know the TF version being used here. Please refer to [this](https://www.tensorflow.org/lite/models/convert) guide for tflite conversion. Thank you!

@sushreebarsa TF version is TF2.6.0, the checkpoint is generated in the same env. I think the key point is how to convert ckpt to pb. Then, I can convert the pb model to tflite version. I have tried the following scheme but it does't work. 
https://stackoverflow.com/questions/69311861/tf2-6-valueerror-model-cannot-be-saved-because-the-input-shapes-have-not-been


https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/tools/freeze_graph.py


@sushreebarsa There are the standalone code:

run_ckpt_to_tflite_test.py is the main function.

[standalone_code.zip](https://github.com/tensorflow/tensorflow/files/13839231/standalone_code.zip)



 This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you. I tried to run a instance before the convert. Then, the workflow seems ok! @TiantianZhang Thank you for the confirmation!
Could you please let us know if we can move this issue to closed status?
Thank you! > @TiantianZhang Thank you for the confirmation! Could you please let us know if we can move this issue to closed status? Thank you!

Thank you for your help. I have resolved the relevant issue. Although there are some unclear areas, I am currently able to complete the corresponding model format conversion. This issue can be closed. Thank you again!


 Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/62735">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/62735">No</a>

model = model_lib.ModelSl(train_args) # get model
checkpoint = tf.train.Checkpoint(model=model) # load weight
checkpoint.restore(latest_ckpt).expect_partial() 
input_shape = (128, 128, 1)
model._set_inputs(input_shape)
converter = tf.lite.TFLiteConverter.from_keras_model(model)
tflite_model = converter.convert() 

errors：

raise TypeError("Invalid input_signature {}; input_signature must be "
TypeError: Invalid input_signature [(None, None, None)]; input_signature must be a possibly nested sequence of TensorSpec objects.
Exception ignored in: <function Pool.__del__ at 0x7f1e64dec0d0>
Traceback (most recent call last):
  File "/home/nnn/.conda/envs/tf2.6.0/lib/python3.9/multiprocessing/pool.py", line 268, in __del__
  File "/home/nnn/.conda/envs/tf2.6.0/lib/python3.9/multiprocessing/queues.py", line 372, in put
AttributeError: 'NoneType' object has no attribute 'dumps'



if i delete the shape, the errors just as follows:


model = model_lib.ModelSl(train_args) # get model
checkpoint = tf.train.Checkpoint(model=model) # load weight
checkpoint.restore(latest_ckpt).expect_partial() 
converter = tf.lite.TFLiteConverter.from_keras_model(model)
tflite_model = converter.convert() 

ValueError: Model <models.model.ModelSl object at 0x7f495c9c8af0> cannot be saved because the input shapes have not been set. Usually, input shapes are automatically determined from calling `.fit()` or `.predict()`. To manually set the shapes, call `model.build(input_shape)`.
python-BaseException
Exception ignored in: <function Pool.__del__ at 0x7f49686ad0d0>
Traceback (most recent call last):
  File "/home/nnn/.conda/envs/tf2.6.0/lib/python3.9/multiprocessing/pool.py", line 268, in __del__
  File "/home/nnn/.conda/envs/tf2.6.0/lib/python3.9/multiprocessing/queues.py", line 372, in put
AttributeError: 'NoneType' object has no attribute 'dumps'





