I am currently trying to train a cGAN model from scratch. It works fine, however, the training seems very slow for the hardware I use (4090). To learn the most from this issue, I would like to spot an error in my code first. I am not sure if I can just copy paste the whole model (200 lines of code), so maybe someone experience a similar problem or is quite experienced and can tell me what possibly could be wrong.
For example, currently I am using
dataloader = torch.utils.data.DataLoader(
Adding num_workers = 4, the training is approx 5 times faster, but I am not sure if this is a good thing to change. However, since small changes like that have such a high impact, I wonder what else there is to optimize.