Producer process has been terminated before all shared CUDA tensors released. See Note [Sharing CUDA tensors]
while running the training, the following error Producer process has been terminated before all shared CUDA tensors released. See Note [Sharing CUDA tensors] occurs in the end of every epoch.
This is due to parameter num_workers in the Dataloader... the .to(device) in NYUDepthV2 interferes the multi-process loading of the dataloader. Setting the num_workers to zero solve the problem but the loading takes more time.