I have written a snipet that should output 10 images that were misclassified by my model.
fig = plt.figure(figsize=(20, 8))

for idx in np.arange(10):
    ax = fig.add_subplot(2, 10/2, idx+1, xticks=[], yticks=[])
    #std = np.array([0.229, 0.224, 0.225])
    #mean = np.array([0.485, 0.456, 0.406])
    img = incorrect_examples[idx][idx]
    img = img/2 + 0.5
    img = np.clip(img, 0, 1)
    ax.imshow(img)
    ax.set_title(f"{classes[pred[idx]]}: x%\n (label: {classes[target[idx]]})",
                 color=("green" if pred[idx] == target[idx].item() else "red"))

I get the following error:
---> 10     ax.imshow(img)
     11     ax.set_title(f"{classes[pred[idx]]}: x%\n (label: {classes[target[idx]]})",
     12                  color=("green" if pred[idx] == target[idx].item() else "red"))

4 frames
/usr/local/lib/python3.7/dist-packages/matplotlib/image.py in set_data(self, A)
    697                 or self._A.ndim == 3 and self._A.shape[-1] in [3, 4]):
    698             raise TypeError("Invalid shape {} for image data"
--> 699                             .format(self._A.shape))
    700 
    701         if self._A.ndim == 3:

TypeError: Invalid shape (1, 3, 224, 224) for image data