It looks like something is wrong with the last partial minibatch, e.g. maybe it does not have two dimensions.