I'm now using this YOLOv4 code, and the inference is done (as code below) by 1) calling a tf.saved_model
, and 2) get the signature
wrapper for a forward pass.
self.saved_model_loaded = tf.saved_model.load(self.weights_path, tags=[tag_constants.SERVING])
self.infer = self.saved_model_loaded.signatures['serving_default']
But what should I do, if I want to simply save this model at inference mode, as a tf.keras object? I found this official tutorial a bit helpful, but still cannot figure out how...
My ultimate goal is to use tf.keras
to construct a new model, where I can output both intermediate layer and final output. So I need to infer without using this signature function, i.e. making it a default setting.
Or you have other solutions? Thanks in advance!!
question from:
https://stackoverflow.com/questions/65933995/how-to-transfer-a-tf-saved-model-with-specific-signature-to-a-tf-keras-model 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…