如何解决在 Colab 中使用 Sementation 模型导入 UNet 时出错
我对机器学习还很陌生。
我试图在 Google colab 上使用 Segmentation 模型进行一些语义分割。
我刚刚安装了带有线的 Segmentations 模型。
pip install git+https://github.com/qubvel/segmentation_models
然后,在块中的“model=sm.Unet(~~”行。我得到了错误代码。
BACKBONE = 'resnet34'
preprocess_input = sm.get_preprocessing(BACKBONE)
# define model
model = sm.Unet(BACKBONE,encoder_weights='imagenet')
model.compile(optimizer='adam',loss='sm.losses.bce_jaccard_loss',metrics=[sm.metrics.iou_score,'mse'])
print(model.summary())
这是错误代码。
/usr/local/lib/python3.7/dist-packages/classification_models/weights.py in load_model_weights(model,model_name,dataset,classes,include_top,**kwargs)
23 ' as true,`classes` should be {}'.format(weights['classes']))
24
---> 25 weights_path = keras_utils.get_file(
26 weights['name'],27 weights['url'],AttributeError: module 'keras.utils' has no attribute 'get_file'
有人可以帮我解决问题吗?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。