Trouble running cifar example

Hey Guys,
I am learning PyTorch atm and wanted to get my hands dirty with fastai as well.

So I figured just conda install like in the installation section described and I’d be able to run the examples but that did not work out (imports didn’t work). Anyway I ended up after some googling with the fastai git clone dev installation method. The imports of the example notebook examples/cifar.ipynb are running fine now, but I get the following error when running the 4th cell

learn = Learner(data, wrn_22(), metrics=accuracy).to_fp16()
learn.fit_one_cycle(30, 3e-3, wd=0.4, div_factor=10, pct_start=0.5)

The exception message says:

Exception in thread Thread-4:
Traceback (most recent call last):
File “/home/skalar/miniconda3/lib/python3.6/threading.py”, line 916, in _bootstrap_inner
self.run()
File “/home/skalar/miniconda3/lib/python3.6/threading.py”, line 864, in run
self._target(*self._args, **self._kwargs)
File “/home/skalar/miniconda3/lib/python3.6/multiprocessing/resource_sharer.py”, line 139, in _serve
signal.pthread_sigmask(signal.SIG_BLOCK, range(1, signal.NSIG))
File “/home/skalar/miniconda3/lib/python3.6/signal.py”, line 60, in pthread_sigmask
sigs_set = _signal.pthread_sigmask(how, mask)
ValueError: signal number 32 out of range

and that a number of times.

I hope someone can guide me to fix this issue. Looking forward to explore the PyTorch / FastAI universe!

What’s your OS? It looks like pytorch v1 isn’t properly installed from your error.

I am running Arch Linux on the machine producing the error. Any idea what I could try to fix the issue?

Could you give us the result of:

python -c 'import fastai; fastai.show_install(1)'

Here it is:

=== Software === 
python version  : 3.6.5
fastai version  : 1.0.20.dev0
torch version   : 1.0.0.dev20181029
nvidia driver   : 410.66
torch cuda ver  : 9.2.148
torch cuda is   : available
torch cudnn ver : 7104
torch cudnn is  : enabled

=== Hardware === 
nvidia gpus     : 1
torch available : 1
  - gpu0        : 8116MB | GeForce GTX 1080

=== Environment === 
platform        : Linux-4.18.16-arch1-1-ARCH-x86_64-with-arch
distro          : Arch Linux  
conda env       : Unknown
python          : /home/skalar/miniconda3/bin/python
sys.path        : 
/home/skalar/miniconda3/lib/python36.zip
/home/skalar/miniconda3/lib/python3.6
/home/skalar/miniconda3/lib/python3.6/lib-dynload
/home/skalar/miniconda3/lib/python3.6/site-packages
/home/skalar/projects/fastai
/home/skalar/miniconda3/lib/python3.6/site-packages/IPython/extensions

Mon Nov  5 18:32:36 2018       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 410.66       Driver Version: 410.66       CUDA Version: 10.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 1080    Off  | 00000000:65:00.0 Off |                  N/A |
| 25%   29C    P0    38W / 200W |     10MiB /  8116MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

I ran the command in fastai/fastai directory

Not catching anything out of the ordinary. Does the lesson 1 from course v3 work or not? Also does this example run when you remove the fp16 call?

Removing FP16 did not help…

I tried running lesson1-pets from course3 but ran into the same error:
Executing learn.fit_one_cycle(4)
Resulted in:
Exception in thread Thread-6:
Traceback (most recent call last):
File “/home/skalar/miniconda3/lib/python3.6/threading.py”, line 916, in _bootstrap_inner
self.run()
File “/home/skalar/miniconda3/lib/python3.6/threading.py”, line 864, in run
self._target(*self._args, **self._kwargs)
File “/home/skalar/miniconda3/lib/python3.6/multiprocessing/resource_sharer.py”, line 139, in _serve
signal.pthread_sigmask(signal.SIG_BLOCK, range(1, signal.NSIG))
File “/home/skalar/miniconda3/lib/python3.6/signal.py”, line 60, in pthread_sigmask
sigs_set = _signal.pthread_sigmask(how, mask)
ValueError: signal number 32 out of range
Exception in thread Thread-6:
Traceback (most recent call last):
File “/home/skalar/miniconda3/lib/python3.6/threading.py”, line 916, in _bootstrap_inner
self.run()
File “/home/skalar/miniconda3/lib/python3.6/threading.py”, line 864, in run
self._target(*self._args, **self._kwargs)
File “/home/skalar/miniconda3/lib/python3.6/multiprocessing/resource_sharer.py”, line 139, in _serve
signal.pthread_sigmask(signal.SIG_BLOCK, range(1, signal.NSIG))
File “/home/skalar/miniconda3/lib/python3.6/signal.py”, line 60, in pthread_sigmask
sigs_set = _signal.pthread_sigmask(how, mask)
ValueError: signal number 32 out of range
Exception in thread Thread-6:
Traceback (most recent call last):
File “/home/skalar/miniconda3/lib/python3.6/threading.py”, line 916, in _bootstrap_inner
self.run()
File “/home/skalar/miniconda3/lib/python3.6/threading.py”, line 864, in run
self._target(*self._args, **self._kwargs)
File “/home/skalar/miniconda3/lib/python3.6/multiprocessing/resource_sharer.py”, line 139, in _serve
signal.pthread_sigmask(signal.SIG_BLOCK, range(1, signal.NSIG))
File “/home/skalar/miniconda3/lib/python3.6/signal.py”, line 60, in pthread_sigmask
sigs_set = _signal.pthread_sigmask(how, mask)
ValueError: signal number 32 out of range

Exception in thread Thread-6:
Traceback (most recent call last):
File “/home/skalar/miniconda3/lib/python3.6/threading.py”, line 916, in _bootstrap_inner
self.run()
File “/home/skalar/miniconda3/lib/python3.6/threading.py”, line 864, in run
self._target(*self._args, **self._kwargs)
File “/home/skalar/miniconda3/lib/python3.6/multiprocessing/resource_sharer.py”, line 139, in _serve
signal.pthread_sigmask(signal.SIG_BLOCK, range(1, signal.NSIG))
File “/home/skalar/miniconda3/lib/python3.6/signal.py”, line 60, in pthread_sigmask
sigs_set = _signal.pthread_sigmask(how, mask)
ValueError: signal number 32 out of range

Exception in thread Thread-6:
Traceback (most recent call last):
File “/home/skalar/miniconda3/lib/python3.6/threading.py”, line 916, in _bootstrap_inner
self.run()
File “/home/skalar/miniconda3/lib/python3.6/threading.py”, line 864, in run
self._target(*self._args, **self._kwargs)
File “/home/skalar/miniconda3/lib/python3.6/multiprocessing/resource_sharer.py”, line 139, in _serve
signal.pthread_sigmask(signal.SIG_BLOCK, range(1, signal.NSIG))
File “/home/skalar/miniconda3/lib/python3.6/signal.py”, line 60, in pthread_sigmask
sigs_set = _signal.pthread_sigmask(how, mask)
ValueError: signal number 32 out of range

Exception in thread Thread-6:
Traceback (most recent call last):
File “/home/skalar/miniconda3/lib/python3.6/threading.py”, line 916, in _bootstrap_inner
self.run()
File “/home/skalar/miniconda3/lib/python3.6/threading.py”, line 864, in run
self._target(*self._args, **self._kwargs)
File “/home/skalar/miniconda3/lib/python3.6/multiprocessing/resource_sharer.py”, line 139, in _serve
signal.pthread_sigmask(signal.SIG_BLOCK, range(1, signal.NSIG))
File “/home/skalar/miniconda3/lib/python3.6/signal.py”, line 60, in pthread_sigmask
sigs_set = _signal.pthread_sigmask(how, mask)
ValueError: signal number 32 out of range
Exception in thread Thread-6:
Traceback (most recent call last):
File “/home/skalar/miniconda3/lib/python3.6/threading.py”, line 916, in _bootstrap_inner
self.run()
File “/home/skalar/miniconda3/lib/python3.6/threading.py”, line 864, in run
self._target(*self._args, **self._kwargs)
File “/home/skalar/miniconda3/lib/python3.6/multiprocessing/resource_sharer.py”, line 139, in _serve
signal.pthread_sigmask(signal.SIG_BLOCK, range(1, signal.NSIG))
File “/home/skalar/miniconda3/lib/python3.6/signal.py”, line 60, in pthread_sigmask
sigs_set = _signal.pthread_sigmask(how, mask)
ValueError: signal number 32 out of range
Exception in thread Thread-6:
Traceback (most recent call last):
File “/home/skalar/miniconda3/lib/python3.6/threading.py”, line 916, in _bootstrap_inner
self.run()
File “/home/skalar/miniconda3/lib/python3.6/threading.py”, line 864, in run
self._target(*self._args, **self._kwargs)
File “/home/skalar/miniconda3/lib/python3.6/multiprocessing/resource_sharer.py”, line 139, in _serve
signal.pthread_sigmask(signal.SIG_BLOCK, range(1, signal.NSIG))
File “/home/skalar/miniconda3/lib/python3.6/signal.py”, line 60, in pthread_sigmask
sigs_set = _signal.pthread_sigmask(how, mask)
ValueError: signal number 32 out of range
Exception in thread Thread-6:
Traceback (most recent call last):
File “/home/skalar/miniconda3/lib/python3.6/threading.py”, line 916, in _bootstrap_inner
self.run()
File “/home/skalar/miniconda3/lib/python3.6/threading.py”, line 864, in run
self._target(*self._args, **self._kwargs)
File “/home/skalar/miniconda3/lib/python3.6/multiprocessing/resource_sharer.py”, line 139, in _serve
signal.pthread_sigmask(signal.SIG_BLOCK, range(1, signal.NSIG))
File “/home/skalar/miniconda3/lib/python3.6/signal.py”, line 60, in pthread_sigmask
sigs_set = _signal.pthread_sigmask(how, mask)
ValueError: signal number 32 out of range
Exception in thread Thread-6:
Traceback (most recent call last):
File “/home/skalar/miniconda3/lib/python3.6/threading.py”, line 916, in _bootstrap_inner
self.run()
File “/home/skalar/miniconda3/lib/python3.6/threading.py”, line 864, in run
self._target(*self._args, **self._kwargs)
File “/home/skalar/miniconda3/lib/python3.6/multiprocessing/resource_sharer.py”, line 139, in _serve
signal.pthread_sigmask(signal.SIG_BLOCK, range(1, signal.NSIG))
File “/home/skalar/miniconda3/lib/python3.6/signal.py”, line 60, in pthread_sigmask
sigs_set = _signal.pthread_sigmask(how, mask)
ValueError: signal number 32 out of range

Exception in thread Thread-6:
Traceback (most recent call last):
File “/home/skalar/miniconda3/lib/python3.6/threading.py”, line 916, in _bootstrap_inner
self.run()
File “/home/skalar/miniconda3/lib/python3.6/threading.py”, line 864, in run
self._target(*self._args, **self._kwargs)
File “/home/skalar/miniconda3/lib/python3.6/multiprocessing/resource_sharer.py”, line 139, in _serve
signal.pthread_sigmask(signal.SIG_BLOCK, range(1, signal.NSIG))
File “/home/skalar/miniconda3/lib/python3.6/signal.py”, line 60, in pthread_sigmask
sigs_set = _signal.pthread_sigmask(how, mask)
ValueError: signal number 32 out of range

Exception in thread Thread-6:
Traceback (most recent call last):
File “/home/skalar/miniconda3/lib/python3.6/threading.py”, line 916, in _bootstrap_inner
self.run()
File “/home/skalar/miniconda3/lib/python3.6/threading.py”, line 864, in run
self._target(*self._args, **self._kwargs)
File “/home/skalar/miniconda3/lib/python3.6/multiprocessing/resource_sharer.py”, line 139, in _serve
signal.pthread_sigmask(signal.SIG_BLOCK, range(1, signal.NSIG))
File “/home/skalar/miniconda3/lib/python3.6/signal.py”, line 60, in pthread_sigmask
sigs_set = _signal.pthread_sigmask(how, mask)
ValueError: signal number 32 out of range

Exception in thread Thread-6:
Traceback (most recent call last):
File “/home/skalar/miniconda3/lib/python3.6/threading.py”, line 916, in _bootstrap_inner
self.run()
File “/home/skalar/miniconda3/lib/python3.6/threading.py”, line 864, in run
self._target(*self._args, **self._kwargs)
File “/home/skalar/miniconda3/lib/python3.6/multiprocessing/resource_sharer.py”, line 139, in _serve
signal.pthread_sigmask(signal.SIG_BLOCK, range(1, signal.NSIG))
File “/home/skalar/miniconda3/lib/python3.6/signal.py”, line 60, in pthread_sigmask
sigs_set = _signal.pthread_sigmask(how, mask)
ValueError: signal number 32 out of range

Exception in thread Thread-6:
Traceback (most recent call last):
File “/home/skalar/miniconda3/lib/python3.6/threading.py”, line 916, in _bootstrap_inner
self.run()
File “/home/skalar/miniconda3/lib/python3.6/threading.py”, line 864, in run
self._target(*self._args, **self._kwargs)
File “/home/skalar/miniconda3/lib/python3.6/multiprocessing/resource_sharer.py”, line 139, in _serve
signal.pthread_sigmask(signal.SIG_BLOCK, range(1, signal.NSIG))
File “/home/skalar/miniconda3/lib/python3.6/signal.py”, line 60, in pthread_sigmask
sigs_set = _signal.pthread_sigmask(how, mask)
ValueError: signal number 32 out of range

Exception in thread Thread-6:
Traceback (most recent call last):
File “/home/skalar/miniconda3/lib/python3.6/threading.py”, line 916, in _bootstrap_inner
self.run()
File “/home/skalar/miniconda3/lib/python3.6/threading.py”, line 864, in run
self._target(*self._args, **self._kwargs)
File “/home/skalar/miniconda3/lib/python3.6/multiprocessing/resource_sharer.py”, line 139, in _serve
signal.pthread_sigmask(signal.SIG_BLOCK, range(1, signal.NSIG))
File “/home/skalar/miniconda3/lib/python3.6/signal.py”, line 60, in pthread_sigmask
sigs_set = _signal.pthread_sigmask(how, mask)
ValueError: signal number 32 out of range

Exception in thread Thread-6:
Traceback (most recent call last):
File “/home/skalar/miniconda3/lib/python3.6/threading.py”, line 916, in _bootstrap_inner
self.run()
File “/home/skalar/miniconda3/lib/python3.6/threading.py”, line 864, in run
self._target(*self._args, **self._kwargs)
File “/home/skalar/miniconda3/lib/python3.6/multiprocessing/resource_sharer.py”, line 139, in _serve
signal.pthread_sigmask(signal.SIG_BLOCK, range(1, signal.NSIG))
File “/home/skalar/miniconda3/lib/python3.6/signal.py”, line 60, in pthread_sigmask
sigs_set = _signal.pthread_sigmask(how, mask)
ValueError: signal number 32 out of range

Is there an up to date docker container with fastai+torch for GPU available? Maybe that could help…

Run into the same problem on my PC with custom fast.ai installation. Resolved by updating python interpreter version from 3.6.5 to 3.6.6.
https://bugs.python.org/issue33329

The same problem.

Resolved by updating Python3.5 to Python3.7