BUG IN Training a Classifier

username: eslam_fouda
cooked: <p>I installed pytorch 1.7 and cuda 11</p>
<p>then I start learning pytorch but when I implement the code in the following link:<br>
<a href="https://pytorch.org/tutorials/beginner/blitz/cifar10_tutorial.html" rel="noopener nofollow ugc">https://pytorch.org/tutorials/beginner/blitz/cifar10_tutorial.html</a></p>
<p>using jupyter notebook I faced this error:</p>
<p>the kernel appears to have died. it will restart automatically.</p>
<p>I try the following:</p>
<p>first: downgrade to cuda 10.2<br>
then try again with jupyter notebook I face the same error and when trying to rerun the cell that cause the error in the forth step I found the following error:<br>
TypeError: Caught TypeError in DataLoader worker process 0<br>
and try to set num_worker to zero. the cell required to redefine some predefined cells but in vain.</p>
<p>second: I implement the code in simple .py file and found the following error:</p>
<p>Illegal instruction (core dumped)<br>
and found the problem in following lines using print statements:<br>
loss.backward()<br>
optimizer.step()</p>
<p>How can I fix this problem?</p>
<p>Thanks in advance.</p>

username: eslam_fouda
cooked: <p>the computer also starts to hang and give these screens:<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/9/2/927200d1bdc9162fe8f16901cab84a0f659a8e89.jpeg" data-download-href="https://discuss.pytorch.org/uploads/default/927200d1bdc9162fe8f16901cab84a0f659a8e89" title="IMG20201103195103"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/9/2/927200d1bdc9162fe8f16901cab84a0f659a8e89_2_690x388.jpeg" alt="IMG20201103195103" data-base62-sha1="kTvXBGl1Ny5DctSW8FCW2fOHhIR" width="690" height="388" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/9/2/927200d1bdc9162fe8f16901cab84a0f659a8e89_2_690x388.jpeg, https://discuss.pytorch.org/uploads/default/optimized/3X/9/2/927200d1bdc9162fe8f16901cab84a0f659a8e89_2_1035x582.jpeg 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/9/2/927200d1bdc9162fe8f16901cab84a0f659a8e89_2_1380x776.jpeg 2x" data-dominant-color="515156"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">IMG20201103195103</span><span class="informations">4096×2304 2.78 MB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>

username: eslam_fouda
cooked: <p><div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/c/3/c3e2be713473f749e8fc04688c820d9b85f84f45.jpeg" data-download-href="https://discuss.pytorch.org/uploads/default/c3e2be713473f749e8fc04688c820d9b85f84f45" title="IMG20201103195812"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/c/3/c3e2be713473f749e8fc04688c820d9b85f84f45_2_690x388.jpeg" alt="IMG20201103195812" data-base62-sha1="rWSU0pX6emKA6Nu6bL7y9p752bH" width="690" height="388" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/c/3/c3e2be713473f749e8fc04688c820d9b85f84f45_2_690x388.jpeg, https://discuss.pytorch.org/uploads/default/optimized/3X/c/3/c3e2be713473f749e8fc04688c820d9b85f84f45_2_1035x582.jpeg 1.5x, https://discuss.pytorch.org/uploads/default/optimized/3X/c/3/c3e2be713473f749e8fc04688c820d9b85f84f45_2_1380x776.jpeg 2x" data-dominant-color="4F4D51"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">IMG20201103195812</span><span class="informations">4096×2304 2.3 MB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><br>
was found before the problem</p>

username: eslam_fouda
cooked: <p>my system info is:<br>
GPU gtx 1070<br>
(base) eslam@scholar:~$ cat /proc/cpuinfo<br>
processor	: 0<br>
vendor_id	: AuthenticAMD<br>
cpu family	: 16<br>
model		: 6<br>
model name	: AMD Athlon™ II X2 250 Processor<br>
stepping	: 3<br>
microcode	: 0x10000c8<br>
cpu MHz		: 1800.000<br>
cache size	: 1024 KB<br>
physical id	: 0<br>
siblings	: 2<br>
core id		: 0<br>
cpu cores	: 2<br>
apicid		: 0<br>
initial apicid	: 0<br>
fpu		: yes<br>
fpu_exception	: yes<br>
cpuid level	: 5<br>
wp		: yes<br>
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt hw_pstate vmmcall npt lbrv svm_lock nrip_save<br>
bugs		: tlb_mmatch fxsave_leak sysret_ss_attrs null_seg spectre_v1 spectre_v2<br>
bogomips	: 6026.74<br>
TLB size	: 1024 4K pages<br>
clflush size	: 64<br>
cache_alignment	: 64<br>
address sizes	: 48 bits physical, 48 bits virtual<br>
power management: ts ttp tm stc 100mhzsteps hwpstate</p>
<p>processor	: 1<br>
vendor_id	: AuthenticAMD<br>
cpu family	: 16<br>
model		: 6<br>
model name	: AMD Athlon™ II X2 250 Processor<br>
stepping	: 3<br>
microcode	: 0x10000c8<br>
cpu MHz		: 2300.000<br>
cache size	: 1024 KB<br>
physical id	: 0<br>
siblings	: 2<br>
core id		: 1<br>
cpu cores	: 2<br>
apicid		: 1<br>
initial apicid	: 1<br>
fpu		: yes<br>
fpu_exception	: yes<br>
cpuid level	: 5<br>
wp		: yes<br>
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt hw_pstate vmmcall npt lbrv svm_lock nrip_save<br>
bugs		: tlb_mmatch fxsave_leak sysret_ss_attrs null_seg spectre_v1 spectre_v2<br>
bogomips	: 6026.74<br>
TLB size	: 1024 4K pages<br>
clflush size	: 64<br>
cache_alignment	: 64<br>
address sizes	: 48 bits physical, 48 bits virtual<br>
power management: ts ttp tm stc 100mhzsteps hwpstate</p>
<p>(base) eslam@scholar:~$ sudo dmidecode -t 2<br>
[sudo] password for eslam:</p>
<h1>dmidecode 3.2</h1>
<p>Getting SMBIOS data from sysfs.<br>
SMBIOS 2.4 present.</p>
<p>Handle 0x0002, DMI type 2, 8 bytes<br>
Base Board Information<br>
Manufacturer: Gigabyte Technology Co., Ltd.<br>
Product Name: GA-MA74GMT-S2<br>
Version: x.x<br>
Serial Number:</p>

username: ptrblck
cooked: <p>I would recommend to check the system logs to see what’s causing the machine to restart.<br>
A failing Python script should just raise an error, but shouldn’t take down the whole workstation so I guess your current system might encounter some critical issues.</p>

username: eslam_fouda
cooked: <p>Thanks for your response.<br>
The machine stopped restarting and hanging but the second screen still found.<br>
The error already in the following two lines:<br>
loss.backward()<br>
optimizer.step()</p>

username: eslam_fouda
cooked: <p>I also tried to build from source after I got rid of the two screens but in vain</p>

username: ptrblck
cooked: <p>I still think you are facing a potential hardware error as shown in the screenshot so I would recommend to look into the system error logs and try to find any clues what might be wrong.<br>
If you cannot find anything, try to run some RAM tests etc.</p>

username: eslam_fouda
cooked: <p>I’m beginner. what are system error logs? how could I run some RAM tests?<br>
while install ubuntu 16.04 I faced the second screen above it disappeared after installation.<br>
I faced no original module exists within this kernel while setup gpu driver.</p>

username: ptrblck
cooked: <p>You could start with checking <code>dmesg</code>. However, it seems that your initial installation might have some issues based on your last comments.</p>
<aside class="quote no-group" data-username="eslam_fouda" data-post="9" data-topic="101530">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/eslam_fouda/48/30589_2.png" class="avatar"> eslam_fouda:</div>
<blockquote>
<p>I faced no original module exists within this kernel while setup gpu driver.</p>
</blockquote>
</aside>
<p>Is this the error message you were seeing?</p>