By the way, you may actually run an inference on a given image using the ResNet50 architecture on pretrained ImageNet weights, as we have initialized here. You can do this by first preprocessing the desired image on which you want to run inference into the appropriate four-dimensional tensor format, as shown here. The same of course applies for any dataset of images you may have, as long as they are resized to the appropriate format:
The preceding code reshapes one of our leopard images into a 4D tensor by expanding its dimension along the 0 axis, then feeds the tensor to our initialized ResNet50 model to get a class probability prediction. We then proceed to decode the prediction class into a human-readable output. For fun, we also defined the labels variable, which includes all the possible labels our network predicted for this image...