Fix some bugs
Finish the attribute learning script. But parameters need tuned