computer vision - Illegal instruction error while running C++ inception-v3 on TensorFlow -
i'm attempting run image recognition c++ api tutorial , have illegal instruction
error, while trying execute label_image
, after tensorflow compilation using bazel.
i did following steps:
# after installing bazel dependencies, bazel installer $ mkdir ~/bazel-download && cd ~/bazel-download $ wget https://github.com/bazelbuild/bazel/releases/download/0.3.0/bazel-0.3.0-installer-linux-x86_64.sh -o bazel-0.3.0-installer-linux-x86_64.sh $ chmod +x bazel-0.3.0-installer-linux-x86_64.sh # install bazel in ~/bin $ ./bazel-0.3.0-installer-linux-x86_64.sh --user # add bazel path, if not done $ printf '\nexport path=$path:"~/bin/"\n' >> ~/.bashrc # before this, create new terminal refresh bash path $ mkdir ~/inceptionv3 && cd ~/inceptionv3 # stable version of tensorflow $ git clone https://github.com/tensorflow/tensorflow -b r0.9 $ cd tensorflow # add inceptionv3 data/models c++ api $ wget https://storage.googleapis.com/download.tensorflow.org/models/inception_dec_2015.zip -o tensorflow/examples/label_image/data/inception_dec_2015.zip $ unzip tensorflow/examples/label_image/data/inception_dec_2015.zip -d tensorflow/examples/label_image/data/ # configure tensorflow: set python path, no google cloud platform support, no gpu support $ ./configure # run bazel build allocated resources $ bazel build -c opt --copt=-mavx --verbose_failures --local_resources 2048,2.0,1.0 -j 1 tensorflow/examples/label_image/... # -- here's last log output bazel -- info: compiling tensorflow/core/common_runtime/function.cc: tensorflow/core/common_runtime/function.cc: in lambda function: tensorflow/core/common_runtime/function.cc:392:60: warning: comparison between signed , unsigned integer expressions [-wsign-compare] } else if (rets->size() != ctx->num_outputs()) { ^ info: elapsed time: 6929.927s, critical path: 69.23s # there's no error during compilation, now, if run generated executable: $ ./bazel-bin/tensorflow/examples/label_image/label_image illegal instruction
also, i'm running on docker ubuntu 14.04.4 lts x86_64 container (gcc/g++ version 4.8.4).
i tried running other setup, such using apt-get install bazel, still illegal instruction
error after running executable new compilation.
that being said, python part of tutorial work fine(using python 2.7.6). idea how solve issue c++ api?
edit1: (add more infos cpu) here's output /proc/cpuinfo.
edit2: (trying debug tensorflow) using command compile:
$ bazel build -c dbg --strip=always --copt=-mavx --verbose_failures --local_resources 2048,2.0,1.0 -j 1 tensorflow/examples/label_image/...
and tried debug gdb:
$ -q bazel-bin/tensorflow/examples/label_image/label_image reading symbols bazel-bin/tensorflow/examples/label_image/label_image...(no debugging symbols found)...done. (gdb) set disable-randomization off (gdb) run starting program: /root/.cache/bazel/_bazel_root/b54d699ba1afcab684f4628c78701dbe/execroot/tensorflow/bazel-out/local-dbg/bin/tensorflow/examples/label_image/label_image during startup program terminated signal sigill, illegal instruction. (gdb) backtrace no stack. (gdb) handle sigill nostop signal stop print pass program description sigill no yes yes illegal instruction (gdb) run starting program: /root/.cache/bazel/_bazel_root/b54d699ba1afcab684f4628c78701dbe/execroot/tensorflow/bazel-out/local-dbg/bin/tensorflow/examples/label_image/label_image during startup program terminated signal sigill, illegal instruction. (gdb) backtrace no stack. (gdb) info files symbols "/root/.cache/bazel/_bazel_root/b54d699ba1afcab684f4628c78701dbe/execroot/tensorflow/bazel-out/local-dbg/bin/tensorflow/examples/label_image/label_image". local exec file: `/root/.cache/bazel/_bazel_root/b54d699ba1afcab684f4628c78701dbe/execroot/tensorflow/bazel-out/local-dbg/bin/tensorflow/examples/label_image/label_image', file type elf64-x86-64. entry point: 0x434b10 0x0000000000400270 - 0x000000000040028c .interp 0x000000000040028c - 0x00000000004002ac .note.abi-tag 0x00000000004002ac - 0x00000000004002cc .note.gnu.build-id 0x00000000004002d0 - 0x0000000000400380 .gnu.hash 0x0000000000400380 - 0x00000000004027e0 .dynsym 0x00000000004027e0 - 0x0000000000404667 .dynstr 0x0000000000404668 - 0x0000000000404970 .gnu.version 0x0000000000404970 - 0x0000000000404b70 .gnu.version_r 0x0000000000404b70 - 0x0000000000431360 .rela.dyn 0x0000000000431360 - 0x00000000004334a8 .rela.plt 0x00000000004334a8 - 0x00000000004334c2 .init 0x00000000004334d0 - 0x0000000000434b10 .plt 0x0000000000434b10 - 0x00000000027cfe2f .text 0x00000000027cfe30 - 0x00000000027cfe39 .fini 0x00000000027cfe40 - 0x0000000003890ed0 .rodata 0x0000000003890ed0 - 0x0000000003acc1ec .eh_frame_hdr 0x0000000003acc1f0 - 0x000000000441fc2c .eh_frame 0x000000000441fc2c - 0x000000000444474f .gcc_except_table 0x0000000004644dd0 - 0x0000000004644de0 .tdata 0x0000000004644de0 - 0x0000000004644df8 .tbss 0x0000000004644de0 - 0x0000000004645a70 .init_array 0x0000000004645a70 - 0x0000000004645a78 .fini_array 0x0000000004645a78 - 0x0000000004645a80 .jcr 0x0000000004645a80 - 0x00000000046a5d50 .data.rel.ro 0x00000000046a5d50 - 0x00000000046a5f90 .dynamic 0x00000000046a5f90 - 0x00000000046a6000 .got 0x00000000046a6000 - 0x00000000046a6b30 .got.plt 0x00000000046a6b40 - 0x00000000046a70d0 .data 0x00000000046a70e0 - 0x00000000046aae18 .bss (gdb) break main breakpoint 1 @ 0x436cc0 (gdb) run starting program: /root/.cache/bazel/_bazel_root/b54d699ba1afcab684f4628c78701dbe/execroot/tensorflow/bazel-out/local-dbg/bin/tensorflow/examples/label_image/label_image during startup program terminated signal sigill, illegal instruction. (gdb) backtrace no stack.
so far, since illegal instruction
error caused sigill signal, guess current architecture doesn't match generated machine code. yet, i'm not sure how deal particular issue.
after couple of search, seem --copt=-mavx
actualy parameter passed gcc in order optimize architecture on osx machine as pointed on here. there's no way works on linux "pc" machine.
Comments
Post a Comment