Fix a bug to use tr to build model.