首页 > 解决方案 > Satellite_standard_unet_100epochs_hdf5 找不到这个文件

问题描述

我一直在努力实现航空图像的语义分割模型,所以我参考了一个 youtube 视频,我实现得很好,但是有一个特定的模型他没有上传。所以,我一直在寻找这个文件“satellite_standard_unet_100epochs.hdf5”

我找到了一个类似的文件,但它在编译代码时出现错误:

from keras.models import load_model

model = load_model("/content/drive/MyDrive/archive(1)/satellite_standard_unet_100epochs.hdf5",custom_objects={'dice_loss_plus_2focal_loss': total_loss, 'jacard_coef':jacard_coef})

错误:

ValueError                                Traceback (most recent call last)
<ipython-input-18-14bb7d37a21c> in <module>()
      1 from keras.models import load_model
----> 2 model = load_model("/content/drive/MyDrive/archive (1)/satellite_standard_unet_100epochs.hdf5",custom_objects={'dice_loss_plus_2focal_loss': total_loss, 'jacard_coef':jacard_coef})
      3 
      4 #IOU
      5 y_pred=model.predict(X_test)

5 frames
/usr/local/lib/python3.7/dist-packages/keras/utils/generic_utils.py in deserialize_keras_object(identifier, module_objects, custom_objects, printable_module_name)
    138             if cls is None:
    139                 raise ValueError('Unknown ' + printable_module_name +
--> 140                                  ': ' + class_name)
    141         if hasattr(cls, 'from_config'):
    142             custom_objects = custom_objects or {}

**ValueError: Unknown layer: Functional**

标签: pythonobject-detectionsemantic-segmentation

解决方案


推荐阅读