Closed PapaMadeleine2022 closed 6 years ago
The reason of this situation caused by the implementation of the fully connected (Dense) layers. Normally, Dense layers are defined as follows:
x = Dense(4096, activation='relu', name='fc6')(x)
x = Dense(4096, activation='relu', name='fc7')(x)
These definitions make the output of each layer also calculated by 'Relu' operation which sets the negative values to zero. I have updated the source code and separated the activation functions as layers. This solution is not perfect but it should allow us to obtain Dense layer outputs easily. You may update the library and use your code without any change.
Note: Any solution for getting the output of certain Tensor variable from the model is still welcomed.
@rcmalli I think that your solution is the best solution.
@rcmalli thank you for your explanation.
sorry to bother you. I am a fresh hand for face recognition and keras. I want to use your
Feature Extraction
code to get the face feature in FC7. But I find the most elements of the FC7 feature are zero. Is this right?below is my code: