fix bug in dp train script