Solved by Nikronic in post #5 
              
              
                Hi, 
This works with folders or tar files. If you use only folder name plus your file name, it will not use any function related to tar processing. 
from PIL import Image
from torchvision.transforms import ToTensor, ToPILImage
import numpy as np
import random

import tarfile
import io
import os
impo…