Generating the loaders takes a long time atleast for Imagenet. Instead of generating it everytime, i ran it once and stored it as a pickle file. Though i am not sure if this is the optimal way, please let me know if there is any other way.