Solved by Nikronic in post #2 
              
              
                Hi, 
This works if you have image dataset in .tar file. 
You have to have a .csv or .txt file, including a name per line of your dataset. 
from PIL import Image
from torchvision.transforms import ToTensor, ToPILImage
import numpy as np
import random

import tarfile
import io
import os
import pandas …