If a single sample already causes the OOM issue, it might be easier to call the models separately to reduce the memory usage and concatenate (and store) the features afterwards.
If you don’t want to train the ensemble, but only want to get the features, you should also wrap the code into with torch.no_grad() to save additional memory.