add debug for training and testing