[ML][Train] Fixes for error types of compile() and run()