PytorchLearning:

for fn_OI, fn_NI in filenames_OI, filenames_NI:


Ow I am really sorry, I forgot many things. In python when you want to loop over two things, you need to use zip like this:
for fn_OI, fn_NI in zip(filenames_OI, filenames_NI):

Let me know if it works.