@albanD: Thanks for your suggestion. Accordingly, I changed  batch.append(img.reshape(1, 299, 299, 3)) to batch.append(img). Also had to remove np.squeeze(trX, axis = 1) and np.squeeze(teX, axis = 1). But still getting the same error:

image.png997×361 66.2 KB

Thanks!