Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

training performance on pre trained models #1

Open
soans1994 opened this issue Aug 31, 2021 · 0 comments
Open

training performance on pre trained models #1

soans1994 opened this issue Aug 31, 2021 · 0 comments

Comments

@soans1994
Copy link

soans1994 commented Aug 31, 2021

hello author,

i tried similar keypoint detection with pre trained(imagenet) vgg and mobilenet models. but the training accuracy is 1% , why is that. when i try simple model with few conv blocks, the accuracy is upto 40%. am i doing something wrong? my dataset is hand dataset with hand keypoints.

edit: i used vgg16 pre trained model as follows:

from keras.layers import Input, Lambda, Dense, Flatten
from keras.models import Model, Sequential
from keras.applications.vgg16 import VGG16, preprocess_input
import tensorflow as tf

input_shape = (224,224,3)
num_classes = 42
def model(input_shape,num_classes):

vgg = VGG16(
include_top=False, weights="imagenet", input_tensor=None,
input_shape=input_shape)
"""
for layer in vgg.layers:
    layer.trainable=False
x = Flatten()(vgg.output)
output = Dense(num_classes, activation="softmax")(x)
model = Model(vgg.input, output)
"""
vgg.trainable=True
global_average_layer = tf.keras.layers.GlobalAveragePooling2D()
prediction_layer = tf.keras.layers.Dense(num_classes, activation='softmax')
model = tf.keras.Sequential([ vgg, global_average_layer, prediction_layer])
model.summary()
return model

if name=="main":
model(input_shape,num_classes)

thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant