First thanks for your reply.
I get the same error with or without torch.autograph.set_detect_anomaly(True)
(it was used only to get more information about the problem)
torch version is 1.1.0
In fact I cannot reach first epoch, the dataset is too big and was taking too much time on CPU.
Cpu was used to be sure the model was correct before training (faster) on server Gpu.
I managed to solve the problem (I guess)
In pytorch doc, it says for the DataLoader class :
num_workers : how many subprocesses to use for data loading
I was thinking that the batch size was splitted among workers to accelerate loading of one batch only.
In fact each worker load one batch, which takes num_workers times more Ram.
Still, I was believing of a memory leak because ram is filled up slowly but reach an equilibrium after hundreds of iterations (don’t know why so many)
Don’t know if the doc was unclear or if I’m just a rookie… Thanks a lot for the help and sorry to had bothered you.