Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Illegal instruction (core dumped) after running import tensorflow

I created a fresh virtual environment: virtualenv -p python2 test_venv/ And installed tensorflow: pip install --upgrade --no-cache-dir tensorflow

import tensorflow gives me Illegal instruction (core dumped)

Please help me understand what's going on and how I can fix it. Thank you.

CPU information:

-cpu           description: CPU           product: Intel(R) Core(TM) i3 CPU       M 330  @ 2.13GHz           bus info: cpu@0           version: CPU Version           capabilities: x86-64 fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 popcnt lahf_lm tpr_shadow vnmi flexpriority ept vpid dtherm arat cpufreq 

Stacktrace obtained with gdb:

#0  0x00007fffe5793880 in std::pair<std::__detail::_Node_iterator<std::pair<tensorflow::StringPiece const, std::function<bool (tensorflow::Variant*)> >, false, true>, bool> std::_Hashtable<tensorflow::StringPiece, std::pair<tensorflow::StringPiece const, std::function<bool (tensorflow::Variant*)> >, std::allocator<std::pair<tensorflow::StringPiece const, std::function<bool (tensorflow::Variant*)> > >, std::__detail::_Select1st, std::equal_to<tensorflow::StringPiece>, tensorflow::StringPieceHasher, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_M_emplace<std::pair<tensorflow::StringPiece, std::function<bool (tensorflow::Variant*)> > >(std::integral_constant<bool, true>, std::pair<tensorflow::StringPiece, std::function<bool (tensorflow::Variant*)> >&&) ()    from /media/gerry/hdd_1/ws_hdd/test_venv/local/lib/python2.7/site-packages/tensorflow/python/../libtensorflow_framework.so #1  0x00007fffe5795735 in tensorflow::UnaryVariantOpRegistry::RegisterDecodeFn(std::string const&, std::function<bool (tensorflow::Variant*)> const&) () from /media/gerry/hdd_1/ws_hdd/test_venv/local/lib/python2.7/site-packages/tensorflow/python/../libtensorflow_framework.so #2  0x00007fffe5770a7c in tensorflow::variant_op_registry_fn_registration::UnaryVariantDecodeRegistration<tensorflow::Tensor>::UnaryVariantDecodeRegistration(std::string const&) ()    from /media/gerry/hdd_1/ws_hdd/test_venv/local/lib/python2.7/site-packages/tensorflow/python/../libtensorflow_framework.so #3  0x00007fffe56ea165 in _GLOBAL__sub_I_tensor.cc ()    from /media/gerry/hdd_1/ws_hdd/test_venv/local/lib/python2.7/site-packages/tensorflow/python/../libtensorflow_framework.so #4  0x00007ffff7de76ba in call_init (l=<optimized out>, argc=argc@entry=2, argv=argv@entry=0x7fffffffd5c8, env=env@entry=0xa7b4d0)     at dl-init.c:72 #5  0x00007ffff7de77cb in call_init (env=0xa7b4d0, argv=0x7fffffffd5c8, argc=2, l=<optimized out>) at dl-init.c:30 #6  _dl_init (main_map=main_map@entry=0xa11920, argc=2, argv=0x7fffffffd5c8, env=0xa7b4d0) at dl-init.c:120 #7  0x00007ffff7dec8e2 in dl_open_worker (a=a@entry=0x7fffffffb5c0) at dl-open.c:575 #8  0x00007ffff7de7564 in _dl_catch_error (objname=objname@entry=0x7fffffffb5b0, errstring=errstring@entry=0x7fffffffb5b8,      mallocedp=mallocedp@entry=0x7fffffffb5af, operate=operate@entry=0x7ffff7dec4d0 <dl_open_worker>, args=args@entry=0x7fffffffb5c0)     at dl-error.c:187 #9  0x00007ffff7debda9 in _dl_open (     file=0x7fffea7cbc34 "/media/gerry/hdd_1/ws_hdd/test_venv/local/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow_internal.so", mode=-2147483646, caller_dlopen=0x51ad19 <_PyImport_GetDynLoadFunc+233>, nsid=-2, argc=<optimized out>, argv=<optimized out>, env=0xa7b4d0)     at dl-open.c:660 #10 0x00007ffff75ecf09 in dlopen_doit (a=a@entry=0x7fffffffb7f0) at dlopen.c:66 #11 0x00007ffff7de7564 in _dl_catch_error (objname=0x9b1870, errstring=0x9b1878, mallocedp=0x9b1868, operate=0x7ffff75eceb0 <dlopen_doit>,      args=0x7fffffffb7f0) at dl-error.c:187 #12 0x00007ffff75ed571 in _dlerror_run (operate=operate@entry=0x7ffff75eceb0 <dlopen_doit>, args=args@entry=0x7fffffffb7f0) at dlerror.c:163 #13 0x00007ffff75ecfa1 in __dlopen (file=<optimized out>, mode=<optimized out>) at dlopen.c:87 #14 0x000000000051ad19 in _PyImport_GetDynLoadFunc () #15 0x000000000051a8e4 in _PyImport_LoadDynamicModule () #16 0x00000000005b7b1b in ?? () #17 0x00000000004bc3fa in PyEval_EvalFrameEx () #18 0x00000000004c136f in PyEval_EvalFrameEx () #19 0x00000000004b9ab6 in PyEval_EvalCodeEx () #20 0x00000000004b97a6 in PyEval_EvalCode () #21 0x00000000004b96df in PyImport_ExecCodeModuleEx () #22 0x00000000004b2b06 in ?? () #23 0x00000000004a4ae1 in ?? () 
like image 614
Gerry Avatar asked Mar 04 '18 10:03

Gerry


People also ask

What does illegal instruction core dumped mean?

@urbansound8K Illegal instruction (core dumped) often means that you tried to run a command that your system lacked resources to complete (i.e. not enough RAM, CPUs etc.).


1 Answers

I would use older version. Looks like your CPU does not support AVX instructions.

Quoting from their Release Page

Breaking Changes Prebuilt binaries are now built against CUDA 9.0 and cuDNN 7. Prebuilt binaries will use AVX instructions. This may break TF on older CPUs. 

You have atleast two options:

  1. Use tensorflow 1.5 or older

  2. Build from source

Regarding your concern for differences, you will miss out on new features, but most basic features and documentations are not that different.

like image 161
Dinesh Avatar answered Sep 29 '22 01:09

Dinesh