我正在尝试使用efficientnet对我的数据集进行自定义训练。
我发现在所有其他代码/数据/配置相同的情况下,efficientnet.tfkeras.EfficientNetB0可以达到约90%的训练/预测准确性,而tf.keras.applications.efficientnet.EfficientNetB0仅能达到约70%的准确性。
但我猜两者应该是相同的efficient net实现,或者我在这里错过了什么?
我正在使用最新的efficientnet和Tensorflow 2.3.0。
with strategy.scope():
model = tf.keras.Sequential([
efficientnet.tfkeras.EfficientNetB0( #tf.keras.applications.efficientnet.EfficientNetB0
input_shape=(IMAGE_SIZE, IMAGE_SIZE, 3),
weights='imagenet',
include_top=False
),
L.GlobalAveragePooling2D(),
L.Dense(1, activation='sigmoid')
])
model.compile(
optimizer='adam',
loss='binary_crossentropy',
metrics=['binary_crossentropy']
)
model.summary()