When I use Dataloader to load data with num_worker>0, I got the following error:
Exception in thread Thread-1:
Traceback (most recent call last):
File "/home/Maro/anaconda3/envs/pytorch/lib/python3.5/threading.py", line 914, in _bootstrap_inner
self.run()
File "/home/Maro/anaconda3/envs/pytorch/lib/python3.5/threading.py", line 862, in run
self._target(*self._args, **self._kwargs)
File "/home/Maro/anaconda3/envs/pytorch/lib/python3.5/multiprocessing/resource_sharer.py", line 139, in _serve
signal.pthread_sigmask(signal.SIG_BLOCK, range(1, signal.NSIG))
File "/home/Maro/anaconda3/envs/pytorch/lib/python3.5/signal.py", line 60, in pthread_sigmask
sigs_set = _signal.pthread_sigmask(how, mask)
ValueError: signal number 32 out of range
And I must set num_workers to 0, but it cost too much time in loading data in each iteration.
Is there any good way to solve this problem? Any advice will be highly appreciated.
I have run the same code on two server with the same os (Ubuntu16.04.1) but different gpu. And set num_workers=12 in DataLoader for both. One can run normally but another raise the ValueError mentioned above.
I’ve never seen this error on my machine, but searching for it it looks like Python 3.7 could fix this issue.
Would it be possible for you to create a new conda environment and try the code with Python 3.7?
If not, could you post a code snippet so that we can reproduce this error?
Another question, though it does not relate to this topic:
If I have two cards ( card0 and card1 ) and train my network just on card1, when I set pin_memory=True in DataLoader it will occupy a portion of card0’s memory ( it seems to be the default ), is there any way to assign memory consumption to card1?
Thanks a lot.
PS: In another machine it works fine with Python3.5, it is so strange and I dont know what makes the mistake.