If num_workers=0 and i interrupt the procedure the error i get:
Epoch: 0
^CTraceback (most recent call last):
  File "train.py", line 147, in <module>
    train(epoch)
  File "train.py", line 74, in train
    for batch_idx, (inputs, targets,indices) in enumerate(trainloader):
  File "/home/gal/.conda/envs/audio/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 345, in __next__
    data = self._next_data()
  File "/home/gal/.conda/envs/audio/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 385, in _next_data
    data = self._dataset_fetcher.fetch(index)  # may raise StopIteration
  File "/home/gal/.conda/envs/audio/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/home/gal/.conda/envs/audio/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/home/gal/mixture-of-experts/datasets/ichbi.py", line 39, in __getitem__
    spectorgrams = split_according_to_cycle(audio_file, ann)
  File "/home/gal/mixture-of-experts/datasets/ichbi.py", line 55, in split_according_to_cycle
    rasp_cycle = torch.cat([rasp_cycle, rasp_cycle] ,1)
KeyboardInterrupt


if the num_workers=1 i get:
^CTraceback (most recent call last):
  File "train.py", line 147, in <module>
    train(epoch)
  File "train.py", line 74, in train
    for batch_idx, (inputs, targets,indices) in enumerate(trainloader):
  File "/home/gal/.conda/envs/audio/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 345, in __next__
    data = self._next_data()
  File "/home/gal/.conda/envs/audio/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 841, in _next_data
    idx, data = self._get_data()
  File "/home/gal/.conda/envs/audio/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 798, in _get_data
    success, data = self._try_get_data()
  File "/home/gal/.conda/envs/audio/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 761, in _try_get_data
    data = self._data_queue.get(timeout=timeout)
  File "/home/gal/.conda/envs/audio/lib/python3.6/queue.py", line 173, in get
    self.not_empty.wait(remaining)
  File "/home/gal/.conda/envs/audio/lib/python3.6/threading.py", line 299, in wait
    gotit = waiter.acquire(True, timeout)
KeyboardInterrupt


my guess is that there is a data lock or something, how can i fix this issue?