IK constraint following object goes haywire
Go into the armature in edit mode and bend the knees in the direction they are supposed to bend just a tiny bit.

If the legs are completely straight, the ik constraint might get confused which way to bend the knees. 

Or give the IK constraint a pole target.
I made a video on this here:
https://vimeo.com/171279647

If you upload your .blend I can make a .gif on your specific example.
https://blend-exchange.giantcowfilms.com/