python - 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**
解决方案
推荐阅读
- c# - 如何配置 IIS 以运行 .net core 2.2?
- ios - pod 'Firebase' 未安装
- r - 在 R markdown 中,如何在 r 块设置为 results = 'asis' 时输出可排序表
- ios - SwiftUI 中的 textFieldDidBeginEditing 和 textFieldDidEndEditing
- python - Keras predict_proba 中的神经网络总是返回概率等于 1
- docker - docker image - GraphDriver 的合并/diff/work/LowerDir 组件
- flutter - 我想将变量从一个类传递到另一个类
- aws-lambda - AWS API Gateway - Lambda 代理(集成请求) - 内部服务器错误
- vba - 当电子邮件率增加时发送警报的收件箱规则
- sql-server - 我收到语法错误,不知道如何修复它们