I’m sorry for making this issue more confusing than It’s supposed to be.
At the end with 3 workers I had to restart my PC, because even the UI freezed.
I’m currently running the script with 0 workers, and for now It’s working. With 3 workers I was also experiencing lag spike, and what it looked like a UI refresh (I don’t know how to better describe it).
Following what you advised me, here it is what happens if i I use timeout in the dataloader:
Traceback (most recent call last):
  File "train_AD.py", line 332, in <module>
    train_net(args,cfg, DEBUG, model)
  File "train_AD.py", line 215, in train_net
    for inputs,x_2,target_availabilities,target_positions,targert_yaws in train_dataloader:
  File "/home/lorenzo/.local/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 435, in __next__
    data = self._next_data()
  File "/home/lorenzo/.local/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1068, in _next_data
    idx, data = self._get_data()
  File "/home/lorenzo/.local/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1021, in _get_data
    raise RuntimeError('DataLoader timed out after {} seconds'.format(self._timeout))
RuntimeError: DataLoader timed out after 3 seconds