Check if targets is a numpy array and convert it into one if it isn't