davidsandberg / facenet

Face recognition using Tensorflow
MIT License
13.84k stars 4.81k forks source link

Model loss is constant at alpha. #916

Open hardik124 opened 6 years ago

hardik124 commented 6 years ago

Hey, I tried porting your repository to a keras version , but for some reason, when I train, the validation loss is always 0.2 which is alpha for me, but training loss keeps on changing. My base network is

base_network = keras.applications.inception_resnet_v2.InceptionResNetV2(input_shape=input_shape,weights=None,include_top=False) x = base_network.output out = GlobalAveragePooling2D()(x) out = Dense(128)(out) norm_layer = Lambda(lambda x: K.l2_normalize(x, axis=1), name='norm_layer')(out) base_network = Model(base_network.input,norm_layer) print(base_network.summary())

vaibhav0195 commented 5 years ago

Hi I was stuck with the same error while using tensorflow slim models. but I changed a parameter called "is_trainable" and set to True and it resolved the issue. So there might be a similar param for you too for "keras.applications.inception_resnet_v2.InceptionResNetV2" changing that param might help :).