fixed issue with generate_training file. finally working.