tensorflow: Bus Error when running a session

System information

  • Running on an ODROID-XU4
  • Have I written custom code: No
  • OS Platform and Distribution: Linux Ubuntu Mate 16.04
  • CUDA/cuDNN version: N/A
  • GPU model and memory: N/A
  • TensorFlow installed from: source
  • TensorFlow version: 1.4.0
  • Python version: 3.5.2
  • Bazel version: 0.8.0
  • GCC Version: 5.4.0
  • Exact command to reproduce: python3.5 import tensorflow as tf hello = tf.constant(‘Hello, TensorFlow’) sess - tf.Session() print(sess.run(hello))

Describe the problem

I have built and installed TensorFlow as a pip package onboard an ODROID-XU4 (32-bit ARM), following the steps in this guide: https://hackernoon.com/running-yolo-on-odroid-yolodroid-5a89481ec141 Everything went smoothly, and I was able to install TensorFlow after a lengthy build time. However, when I try to run any session (such as in the basic example above), the program fails with a Bus Error. Running pip3 list shows that Tensorflow is indeed installed, and no errors are thrown when I merely import TensorFlow.

Source code / logs

I traced the bus error by looking into the /var/log/syslog file and found the following lines associated with the error: Dec 2 21:24:21 odroid kernel: [ 3658.433306] Alignment trap: python3.5 (10189) PC=0xac0bac42 Instr=0xf9068a1f Address=0xbe8a7da4 FSR 0x811 Dec 2 21:24:21 odroid kernel: [ 3658.433313] Alignment trap: not handling instruction f9068a1f at [<ac0bac42>] Dec 2 21:24:21 odroid kernel: [ 3658.439021] Unhandled fault: alignment exception (0x811) at 0xbe8a7da4 So, it appears to be an alignment issue. I tried to force the kernel to attempt to fix the error instead of simply failing by using the following command: echo 3 > /proc/cpu/alignment The three is meant to tell the kernel to fix these alignment issues. However, this strategy has not changed anything about the Bus Error when attempting to run a session.

Perhaps this is related to the 32-bit architecture I am attempting to run on?

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 18 (9 by maintainers)

Most upvoted comments

@PINTO0309

Thanks for the response. Your binary for Pi is working on Odroid XU4.

>>> import tensorflow as tf
/usr/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: compiletime version 3.5 of module 'tensorflow.python.framework.fast_tensor_util' does not match runtime version 3.6
  return f(*args, **kwds)
>>> hello = tf.constant('Hello, TensorFlow!')
>>> sess = tf.Session()
>>> print(sess.run(hello))
b'Hello, TensorFlow!'

Warning msg because binaries are compiled for Python3.5 but Odroid have 3.6.

If anyone installing binary compiled with 3.5 with pip3 of python will get following error msg:

tensorflow-1.11.0-cp35-cp35m-linux_armv7l.whl is not a supported wheel on this platform.

Solution:

  1. Rename file to tensorflow-1.11.0-cp36-cp36m-linux_armv7l.whl
  2. Install using python3 -m pip install tensorflow-1.11.0-cp36-cp36m-linux_armv7l.whl

Enjoy 😃

@Kishwar

I just built a native build on RaspberryPi3 and TX2. There seems to be a problem with cross compile scripts. The point you need to be aware of is that it takes dozens of hours for native builds to use low-spec devices. Unfortunately, I do not own “Odroid”, so I can not try it.