0

运行 load_model 部分时,路径中出现错误。我应该改变什么?我能做些什么来修复它?这是我的代码。当我运行代码时

root = 'gdrive/My Drive/Udemy_DerinOgrenmeyeGiris/Evrisimli_Sinir_Aglari-master/Duygu_Tanima/'

# veri ve görüntüleri yüklemek için parametreler
# image_path = root + 'images/test.jpg'

detection_model_path = root + 'data/detection_models/haarcascade_frontalface_default.xml'
emotion_model_path = root + 'data/emotion_models//fer2013_mini_XCEPTION.110-0.65.hdf5'
gender_model_path = root + 'data/gender_models/simple_CNN.81-0.96.hdf5'
emotion_labels = get_labels('fer2013')
gender_labels = get_labels('imdb')
font = cv2.FONT_HERSHEY_SIMPLEX

# Çerçeve boyutu için hiperparametreler
gender_offsets = (30, 60)
gender_offsets = (10, 10)
emotion_offsets = (20, 40)
emotion_offsets = (0, 0)

# Modelleri yükle
face_detection = load_detection_model(detection_model_path)
emotion_classifier = load_model(emotion_model_path, compile=False)
gender_classifier = load_model(gender_model_path, compile=False)

# Duygu ve cinsiyet tespiti modellerinin giriş boyutları
emotion_target_size = emotion_classifier.input_shape[1:3]
gender_target_size = gender_classifier.input_shape[1:3]

我收到以下错误

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-22-9f4ad607cd47> in <module>()
     19 # Modelleri yükle
     20 face_detection = load_detection_model(detection_model_path)
---> 21 emotion_classifier = load_model(emotion_model_path, compile=False)
     22 gender_classifier = load_model(gender_model_path, compile=False)
     23 
/usr/local/lib/python3.7/dist-packages/tensorflow/python/saved_model/loader_impl.py in parse_saved_model(export_dir)
    114         "SavedModel file does not exist at: %s%s{%s|%s}" %
    115         (export_dir, os.path.sep, constants.SAVED_MODEL_FILENAME_PBTXT,
--> 116          constants.SAVED_MODEL_FILENAME_PB))
    117 
    118 

OSError: SavedModel file does not exist at: gdrive/My Drive/Udemy_DerinOgrenmeyeGiris/Evrisimli_Sinir_Aglari-master/Duygu_Tanima/data/emotion_models/fer2013_mini_XCEPTION.110-0.65.hdf5/{saved_model.pbtxt|saved_model.pb
4

0 回答 0