ptrblck:

The multiple initializations are expected in case you are using num_workers>0, since each worker would create a Dataset copy and would thus also re-initialize the neural network to preprocess the data.


Thank you for reply!
Hmm… I have done this because my number of data is too large and it take too much time to use the neural network(network such as StyleGAN) to augment the dataset. Therefore, I use the neural network in the Dataset to augment the dataset on the fly. Wondering that someone have done this also.