Just clarify since the linked thread is a little bit unclear about the syntax on how to predict on a single image:
trn_tfms, val_tfms = tfms_from_model(arch,sz) # get transformations
im = val_tfms(Image.open('image.png'))
learn.precompute=False # We'll pass in a raw image, not activations
preds = learn.predict_array(im[None])
np.argmax(preds) # preds are log probabilities of classes
(If you simply use Jeremy’s code linked in Phani’s reply, you’ll probably get a running mean
error – that’s since we’re passing in an image and not a precomputed activation, as Jeremy later details here)