I have a question regarding this code that I copied here. Can you tell me how to understand which layers to refer to as the last layer? How did you choose “mixed7” as the last layer?
The question of how many layers to keep from the original model depends on what that model is trained to detect and how much of that makes sense for the model you want to create. There’s no fixed rule about how many layers to keep, but the general concept is that the earlier layers distinguish more coarse, general features, and the later layers get more and more specific in the features they distinguish. Depending on the situation, choosing how many layers to keep can take some guesswork and experimentation. This will get easier with practice and experience.
In this particular case, the Inception model is a image recognition model that can distinguish all sorts of image types, so we can use all of it for our dog vs cat model. That’s why we keep all the layers of the Inception model, up to and including the final layer, “mixed7”. Then we add on our additional layers to specificially pick out cat vs dog.