Redirected stdout to stderr in train method