Useful or not, from you.
tensorflow OSError: SavedModel file does not exist at: main.h5/{saved_model.pbtxt|saved_model.pb}

System information

  • Custom code provided below
  • OS Platform and Distribution : Linux Raspbian
  • Raspberry pi
  • TensorFlow installed from apt repos:
  • TensorFlow version (use command below): tensorflow 1.14
  • Python version: python 3

Describe the current behavior At running, the following line raise the following error:

face_recognition_model = tf.keras.models.load_model('face_recognition_model.h5')

OSError: SavedModel file does not exist at: main.h5/{saved_model.pbtxt|saved_model.pb} Describe the expected behavior Expected to load the model for later prediction

Code to reproduce the issue

detection_graph = tf.Graph()
with detection_graph.as_default():
    od_graph_def = tf.GraphDef()
    with tf.gfile.GFile(PATH_TO_CKPT, 'rb') as fid:
        serialized_graph =
        tf.import_graph_def(od_graph_def, name='')
label_map = label_map_util.load_labelmap(PATH_TO_LABELS)
categories = label_map_util.convert_label_map_to_categories(label_map,
category_index = label_map_util.create_category_index(categories)
face_recognition_model = tf.keras.models.load_model('face_recognition_model.h5')

Other info / logs I provided a snippet to reproduce that error. The all code is using a mobilnet trained by transfer learning to detect faces and a classification network is trained and used on keras for facial recognition. The code is working just fine on my computer and i have absolutely no clue why it's not working on my raspberry pi. I can provide the complete code if it's required.

That's a useful answer
Without any help

Are you satisfied with the resolution of your issue? <a href="">Yes</a> <a href="">No</a>