How did you manage to pass the input with dimension [1, 1, 1024, 1024] into the InceptionResnet?
Anyway, as far as I understand your workflow, you are passing each “slice” into the feature_extractor in the for-loop.
Could you try to pass it as a batch, i.e. change the slice dimension with the batch dimension: x = x.view(70, 1, 1024, 1024) and try it without the loop.
Probably it won’t solve the OOM error, but it’s worth a try.