<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from torchvision.models import vgg16, resnet18
vgg16()"><pre class="notranslate"><code class="notranslate">from torchvision.models import vgg16, resnet18
vgg16()
</code></pre></div>
<p dir="auto">The following interrupt message appears：<br>
<strong>Illegal instruction</strong></p>
<p dir="auto">I installed pytorch(1.2/1.3) from binaries via pip wheels, and I don't know how to solve it.</p>
<p dir="auto">Hello,</p>
<p dir="auto">I have a strange issue when loading some pretrained models. On loading, some models abort and give an "illegal instruction" message, like below:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import torchvision
torchvision.models.squeezenet1_0(pretrained=True)"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">torchvision</span>
<span class="pl-s1">torchvision</span>.<span class="pl-s1">models</span>.<span class="pl-en">squeezenet1_0</span>(<span class="pl-s1">pretrained</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)</pre></div>
<blockquote>
<p dir="auto">Illegal instruction (core dumped)</p>
</blockquote>
<p dir="auto">But with other models, everything runs smoothly. The following code</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import torchvision
torchvision.models.alexnet(pretrained=True)"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">torchvision</span>
<span class="pl-s1">torchvision</span>.<span class="pl-s1">models</span>.<span class="pl-en">alexnet</span>(<span class="pl-s1">pretrained</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)</pre></div>
<p dir="auto">outputs a nicely loaded model:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="AlexNet(
  (features): Sequential(
    (0): Conv2d(3, 64, kernel_size=(11, 11), stride=(4, 4), padding=(2, 2))
    (1): ReLU(inplace=True)
    (2): MaxPool2d(kernel_size=3, stride=2, padding=0, dilation=1, ceil_mode=False)
    (3): Conv2d(64, 192, kernel_size=(5, 5), stride=(1, 1), padding=(2, 2))
    (4): ReLU(inplace=True)
    (5): MaxPool2d(kernel_size=3, stride=2, padding=0, dilation=1, ceil_mode=False)
    (6): Conv2d(192, 384, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
    (7): ReLU(inplace=True)
    (8): Conv2d(384, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
    (9): ReLU(inplace=True)
    (10): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))
    (11): ReLU(inplace=True)
    (12): MaxPool2d(kernel_size=3, stride=2, padding=0, dilation=1, ceil_mode=False)
  )
  (avgpool): AdaptiveAvgPool2d(output_size=(6, 6))
  (classifier): Sequential(
    (0): Dropout(p=0.5, inplace=False)
    (1): Linear(in_features=9216, out_features=4096, bias=True)
    (2): ReLU(inplace=True)
    (3): Dropout(p=0.5, inplace=False)
    (4): Linear(in_features=4096, out_features=4096, bias=True)
    (5): ReLU(inplace=True)
    (6): Linear(in_features=4096, out_features=1000, bias=True)
  )
)"><pre class="notranslate"><span class="pl-v">AlexNet</span>(
  (<span class="pl-s1">features</span>): <span class="pl-v">Sequential</span>(
    (<span class="pl-c1">0</span>): <span class="pl-v">Conv2d</span>(<span class="pl-c1">3</span>, <span class="pl-c1">64</span>, <span class="pl-s1">kernel_size</span><span class="pl-c1">=</span>(<span class="pl-c1">11</span>, <span class="pl-c1">11</span>), <span class="pl-s1">stride</span><span class="pl-c1">=</span>(<span class="pl-c1">4</span>, <span class="pl-c1">4</span>), <span class="pl-s1">padding</span><span class="pl-c1">=</span>(<span class="pl-c1">2</span>, <span class="pl-c1">2</span>))
    (<span class="pl-c1">1</span>): <span class="pl-v">ReLU</span>(<span class="pl-s1">inplace</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)
    (<span class="pl-c1">2</span>): <span class="pl-v">MaxPool2d</span>(<span class="pl-s1">kernel_size</span><span class="pl-c1">=</span><span class="pl-c1">3</span>, <span class="pl-s1">stride</span><span class="pl-c1">=</span><span class="pl-c1">2</span>, <span class="pl-s1">padding</span><span class="pl-c1">=</span><span class="pl-c1">0</span>, <span class="pl-s1">dilation</span><span class="pl-c1">=</span><span class="pl-c1">1</span>, <span class="pl-s1">ceil_mode</span><span class="pl-c1">=</span><span class="pl-c1">False</span>)
    (<span class="pl-c1">3</span>): <span class="pl-v">Conv2d</span>(<span class="pl-c1">64</span>, <span class="pl-c1">192</span>, <span class="pl-s1">kernel_size</span><span class="pl-c1">=</span>(<span class="pl-c1">5</span>, <span class="pl-c1">5</span>), <span class="pl-s1">stride</span><span class="pl-c1">=</span>(<span class="pl-c1">1</span>, <span class="pl-c1">1</span>), <span class="pl-s1">padding</span><span class="pl-c1">=</span>(<span class="pl-c1">2</span>, <span class="pl-c1">2</span>))
    (<span class="pl-c1">4</span>): <span class="pl-v">ReLU</span>(<span class="pl-s1">inplace</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)
    (<span class="pl-c1">5</span>): <span class="pl-v">MaxPool2d</span>(<span class="pl-s1">kernel_size</span><span class="pl-c1">=</span><span class="pl-c1">3</span>, <span class="pl-s1">stride</span><span class="pl-c1">=</span><span class="pl-c1">2</span>, <span class="pl-s1">padding</span><span class="pl-c1">=</span><span class="pl-c1">0</span>, <span class="pl-s1">dilation</span><span class="pl-c1">=</span><span class="pl-c1">1</span>, <span class="pl-s1">ceil_mode</span><span class="pl-c1">=</span><span class="pl-c1">False</span>)
    (<span class="pl-c1">6</span>): <span class="pl-v">Conv2d</span>(<span class="pl-c1">192</span>, <span class="pl-c1">384</span>, <span class="pl-s1">kernel_size</span><span class="pl-c1">=</span>(<span class="pl-c1">3</span>, <span class="pl-c1">3</span>), <span class="pl-s1">stride</span><span class="pl-c1">=</span>(<span class="pl-c1">1</span>, <span class="pl-c1">1</span>), <span class="pl-s1">padding</span><span class="pl-c1">=</span>(<span class="pl-c1">1</span>, <span class="pl-c1">1</span>))
    (<span class="pl-c1">7</span>): <span class="pl-v">ReLU</span>(<span class="pl-s1">inplace</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)
    (<span class="pl-c1">8</span>): <span class="pl-v">Conv2d</span>(<span class="pl-c1">384</span>, <span class="pl-c1">256</span>, <span class="pl-s1">kernel_size</span><span class="pl-c1">=</span>(<span class="pl-c1">3</span>, <span class="pl-c1">3</span>), <span class="pl-s1">stride</span><span class="pl-c1">=</span>(<span class="pl-c1">1</span>, <span class="pl-c1">1</span>), <span class="pl-s1">padding</span><span class="pl-c1">=</span>(<span class="pl-c1">1</span>, <span class="pl-c1">1</span>))
    (<span class="pl-c1">9</span>): <span class="pl-v">ReLU</span>(<span class="pl-s1">inplace</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)
    (<span class="pl-c1">10</span>): <span class="pl-v">Conv2d</span>(<span class="pl-c1">256</span>, <span class="pl-c1">256</span>, <span class="pl-s1">kernel_size</span><span class="pl-c1">=</span>(<span class="pl-c1">3</span>, <span class="pl-c1">3</span>), <span class="pl-s1">stride</span><span class="pl-c1">=</span>(<span class="pl-c1">1</span>, <span class="pl-c1">1</span>), <span class="pl-s1">padding</span><span class="pl-c1">=</span>(<span class="pl-c1">1</span>, <span class="pl-c1">1</span>))
    (<span class="pl-c1">11</span>): <span class="pl-v">ReLU</span>(<span class="pl-s1">inplace</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)
    (<span class="pl-c1">12</span>): <span class="pl-v">MaxPool2d</span>(<span class="pl-s1">kernel_size</span><span class="pl-c1">=</span><span class="pl-c1">3</span>, <span class="pl-s1">stride</span><span class="pl-c1">=</span><span class="pl-c1">2</span>, <span class="pl-s1">padding</span><span class="pl-c1">=</span><span class="pl-c1">0</span>, <span class="pl-s1">dilation</span><span class="pl-c1">=</span><span class="pl-c1">1</span>, <span class="pl-s1">ceil_mode</span><span class="pl-c1">=</span><span class="pl-c1">False</span>)
  )
  (<span class="pl-s1">avgpool</span>): <span class="pl-v">AdaptiveAvgPool2d</span>(<span class="pl-s1">output_size</span><span class="pl-c1">=</span>(<span class="pl-c1">6</span>, <span class="pl-c1">6</span>))
  (<span class="pl-s1">classifier</span>): <span class="pl-v">Sequential</span>(
    (<span class="pl-c1">0</span>): <span class="pl-v">Dropout</span>(<span class="pl-s1">p</span><span class="pl-c1">=</span><span class="pl-c1">0.5</span>, <span class="pl-s1">inplace</span><span class="pl-c1">=</span><span class="pl-c1">False</span>)
    (<span class="pl-c1">1</span>): <span class="pl-v">Linear</span>(<span class="pl-s1">in_features</span><span class="pl-c1">=</span><span class="pl-c1">9216</span>, <span class="pl-s1">out_features</span><span class="pl-c1">=</span><span class="pl-c1">4096</span>, <span class="pl-s1">bias</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)
    (<span class="pl-c1">2</span>): <span class="pl-v">ReLU</span>(<span class="pl-s1">inplace</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)
    (<span class="pl-c1">3</span>): <span class="pl-v">Dropout</span>(<span class="pl-s1">p</span><span class="pl-c1">=</span><span class="pl-c1">0.5</span>, <span class="pl-s1">inplace</span><span class="pl-c1">=</span><span class="pl-c1">False</span>)
    (<span class="pl-c1">4</span>): <span class="pl-v">Linear</span>(<span class="pl-s1">in_features</span><span class="pl-c1">=</span><span class="pl-c1">4096</span>, <span class="pl-s1">out_features</span><span class="pl-c1">=</span><span class="pl-c1">4096</span>, <span class="pl-s1">bias</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)
    (<span class="pl-c1">5</span>): <span class="pl-v">ReLU</span>(<span class="pl-s1">inplace</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)
    (<span class="pl-c1">6</span>): <span class="pl-v">Linear</span>(<span class="pl-s1">in_features</span><span class="pl-c1">=</span><span class="pl-c1">4096</span>, <span class="pl-s1">out_features</span><span class="pl-c1">=</span><span class="pl-c1">1000</span>, <span class="pl-s1">bias</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)
  )
)</pre></div>
<p dir="auto">Running Python 3.7.5 on a CPU only Ubuntu machine with the following versions:<br>
PyTorch Version:  1.4.0+cpu<br>
Torchvision Version:  0.5.0+cpu</p>
<p dir="auto">The CPUs have the following properties:</p>
<blockquote>
<p dir="auto">processor       : 7<br>
vendor_id       : GenuineIntel<br>
cpu family      : 6<br>
model           : 13<br>
model name      : QEMU Virtual CPU version (cpu64-rhel6)<br>
stepping        : 3<br>
microcode       : 0x1<br>
cpu MHz         : 2593.902<br>
cache size      : 4096 KB<br>
physical id     : 7<br>
siblings        : 1<br>
core id         : 0<br>
cpu cores       : 1<br>
apicid          : 7<br>
initial apicid  : 7<br>
fpu             : yes<br>
fpu_exception   : yes<br>
cpuid level     : 4<br>
wp              : yes<br>
flags           : fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pse36 clflush mmx fxsr sse sse2 syscall nx lm nopl cpuid pni cx16 hypervisor lahf_lm abm pti<br>
bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf<br>
bogomips        : 5187.80<br>
clflush size    : 64<br>
cache_alignment : 64<br>
address sizes   : 46 bits physical, 48 bits virtual<br>
power management:</p>
</blockquote>
<p dir="auto">I could not find help anywhere with this issue...</p>