Based on the error message it seems that feats does not always have the desired size as the indexing operation fails. I don’t know, how feats is initialized, but you would have to make sure it’s not depending on e.g. the model predictions.