首页 > 解决方案 > 使用 EfficientNetB0 - 错误 - AttributeError:模块 'keras.utils' 没有属性 'get_file'

问题描述

加载高效网络如下:

import efficientnet.keras as efn
from tensorflow.keras import layers 
from tensorflow.keras import Model 
base_model = efn.EfficientNetB0(input_shape = (224, 224, 3), include_top = False)

并得到以下错误:

AttributeError:模块“keras.utils”没有属性“get_file”

标签: pythontensorflowkeras

解决方案


上面发布的代码仍然无法正常工作。所以,现在使用一种解决方法 -

import efficientnet.tfkeras as efn
base_model = efn.EfficientNetB6(input_shape = (224, 224, 3), include_top = False)

推荐阅读