How do I finetune ResNet50 Keras to only classify images in 2 classes (cats vs. dogs) instead of all 1000 imagenet classes?
There are several ways of applying Transfer Learning and it's trial & error what works best. However, ImageNet includes multiple types of cats and dogs in its 1000 classes, which is why I would do the following:

Add a single Dense layer to your model with 2 outputs
Set only the last layer to trainable
Retrain the network using only images of cats and dogs

This will get solid results rather quickly because you're only training one layer. Meaning, you don't have to backpropagate through the entire network. In addition, your model only has to learn a rather linear mapping from the original cats and dogs subclasses to this binary output.
How do I finetune ResNet50 Keras to only classify images in 2 classes (cats vs. dogs) instead of all 1000 imagenet classes? I used Python and was able to classify random images with ResNet50 and keras with the 1000 ImageNet classes. Now I want to fine tune my code so that it only classifies cats vs. dogs, using the Kaggle images instead of ImageNet. How do I go about doing that?