使用RESNET50时,准确度不会超过13%

问题描述

我正在尝试根据情感对图像进行分类。同样,我正在使用FER数据集。我正在使用resnet进行分类。我的模型如下:

img_height,img_width = 48,48
num_classes = 7
#If imagenet weights are being loaded,#input must have a static square shape (one of (128,128),(160,160),(192,192),or (224,224))
base_model = applications.resnet50.resnet50(weights= None,include_top=False,input_shape= (img_height,img_width,1))


x = base_model.output
x = GlobalAveragePooling2D()(x)
x = Dropout(0.7)(x)
predictions = Dense(num_classes,activation= 'softmax')(x)
model = Model(inputs = base_model.input,outputs = predictions)

from keras.optimizers import SGD,Adam
# sgd = SGD(lr=lrate,momentum=0.9,decay=decay,nesterov=False)
adam = Adam(lr=0.0001)
model.compile(optimizer= adam,loss='categorical_crossentropy',metrics=['accuracy'])


model.fit(trainX,trainY,epochs = 100,batch_size = 64)

运行此模型时,我的准确度未提高14%。有人可以引导我正确的方向来提高我的准确性吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)