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 = fid.read()
        od_graph_def.ParseFromString(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,
                                                            max_num_classes=NUM_CLASSES,
                                                            use_display_name=True)
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="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/35909">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/35909">No</a>