tensorflow-yolov4-tflite
tensorflow-yolov4-tflite copied to clipboard
Inference on saved Tensorflow model
I converted the weights using save_model.py and got the final model. My question is how to load it via Keras/Tensorflow to do inference?
model = tf.saved_model.load(str(model_dir), tags=['serve'])
model = model.signatures['serving_default']
resized_rgb_image = resized_rgb_image.astype(np.float32)
input_image = np.expand_dims(resized_rgb_image, axis=0)
input_tensor = tf.convert_to_tensor(input_image)
output_dict = model(input_tensor)
I get tensorflow.python.framework.errors_impl.FailedPreconditionError
tensorflow.python.framework.errors_impl.FailedPreconditionError: Error while reading resource variable batch_normalization_56/moving_mean_60226 from Container: localhost. This could mean that the variable was uninitialized. Not found: Resource localhost/batch_normalization_56/moving_mean_60226/class tensorflow::Var does not exist.
[[{{node StatefulPartitionedCall/model_1/batch_normalization_56/FusedBatchNormV3/ReadVariableOp}}]] [Op:__inference_signature_wrapper_8573]
I also have this issue. Did you manage to resolve it?
Any solution for this yet?