#keras is now fully integrated into tensorflow, so import like this: from tensorflow.keras.utils import to_categorical