How can i saved pretrained model as "savedmodel" tensorflow format ?
See original GitHub issuetrying to load the weight from checkpoint and save entire model as “.savedmodel” format. Here is my code:
cfg_path = os.path.join(os.path.dirname(__file__), 'configs/retinaface_res50.yaml')
checkpoint_path = os.path.join(os.path.dirname(__file__), 'checkpoints/cpkt-81')
saved_path = os.path.join(os.path.dirname(__file__), 'retinaface_res50')
def main(_):
cfg = load_yaml(cfg_path)
model = RetinaFaceModel(cfg, training=True)
model.summary()
model.load_weights(checkpoint_path).expect_partial()
model.save(saved_path)
it seem cant load the weights by load_weights():
So how do i save pretrained model as a file in tf2 format ?
Issue Analytics
- State:
- Created 3 years ago
- Comments:9
Top Results From Across the Web
Using the SavedModel format | TensorFlow Core
A SavedModel contains a complete TensorFlow program, including trained parameters (i.e, tf.Variable s) and computation. It does not require the original ...
Read more >Save and load models | TensorFlow Core
An entire model can be saved in two different file formats ( SavedModel and HDF5 ). The TensorFlow SavedModel format is the default...
Read more >Migrate the SavedModel workflow | TensorFlow Core
Save and export a SavedModel defined with tf.Module. To export your model in TensorFlow 2, you must define a tf.Module or a tf.keras....
Read more >tf.saved_model.save | TensorFlow v2.11.0
SavedModels exported with tf.saved_model.save strip default-valued attributes automatically, which removes one source of incompatibilities when ...
Read more >Export a SavedModel | TensorFlow Hub
This page describes the details of exporting (saving) a model from a TensorFlow program to the SavedModel format of TensorFlow 2.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I would also like to know. Face detection models in saved model format are rare
I was unable to convert this model to tflite using TFv2.2.0 due to NMS and other native Tensorflow operations. Getting this error :
Has anyone figured out how to port RetinaFace to TensorFlow Lite?