thtrieu / darkflow

Translate darknet to tensorflow. Load trained weights, retrain/fine-tune using tensorflow, export constant graph def to mobile devices
GNU General Public License v3.0
6.13k stars 2.08k forks source link

darkflow error when detecting on raspberry pi zero: undefined symbol: _ZN6google8protobuf8internal26fixed_address_empty_stringE #477

Open stmkjp opened 6 years ago

stmkjp commented 6 years ago

Hi, currently I'm trying to run darkflow on RPi zero with it's camera installed.

detection using darkflow is a little bit slow but working quite well on pi 3. (took several hour to compile opencv3 though) So I thought it's similar on pi zero, but it wasn't.

I managed to install opencv 3.3.1 (took a day to build) and tensorflow ( using
tensorflow-1.4.0-cp35-none-any.whl renamed from tensorflow-1.4.0-cp34-none-any.whl ), and they are working fine (sort of... tensorflow shows some warning due to python version incompatibility - but it's working anyway according to Pete Warden's blog: https://petewarden.com/2017/08/20/cross-compiling-tensorflow-for-the-raspberry-pi )

built darkflow with

python setup.py build_ext --inplace

without any problem. ( it's actually python3, for I'm on venv with python3 )

But when I try to check if detection works with following commands: ./flow --imgdir=sample_img --model cfg/tiny-yolo-voc.cfg --load bin/tiny-yolo-voc.weights --gpu 0

it gives error:

/usr/lib/python3.5/importlib/_bootstrap.py:222: RuntimeWarning: compiletime version 3.4 of module 'tensorflow.python.framework.fast_tensor_util' does not match runtime version 3.5
  return f(*args, **kwds)
/usr/lib/python3.5/importlib/_bootstrap.py:222: RuntimeWarning: builtins.type size changed, may indicate binary incompatibility. Expected 432, got 412
  return f(*args, **kwds)
Traceback (most recent call last):
  File "./flow", line 4, in <module>
    from darkflow.cli import cliHandler
  File "/home/pi/tensor/darkflow/darkflow/cli.py", line 3, in <module>
    from .net.build import TFNet
  File "/home/pi/tensor/darkflow/darkflow/net/build.py", line 5, in <module>
    from .ops import op_create, identity
  File "/home/pi/tensor/darkflow/darkflow/net/ops/__init__.py", line 1, in <module>
    from .simple import *
  File "/home/pi/tensor/darkflow/darkflow/net/ops/simple.py", line 1, in <module>
    import tensorflow.contrib.slim as slim
  File "/home/pi/tensor/lib/python3.5/site-packages/tensorflow/contrib/__init__.py", line 82, in <module>
    from tensorflow.contrib.eager.python import tfe as eager
  File "/home/pi/tensor/lib/python3.5/site-packages/tensorflow/contrib/eager/python/tfe.py", line 76, in <module>
    from tensorflow.contrib.eager.python.datasets import Iterator
  File "/home/pi/tensor/lib/python3.5/site-packages/tensorflow/contrib/eager/python/datasets.py", line 23, in <module>
    from tensorflow.contrib.data.python.ops import prefetching_ops
  File "/home/pi/tensor/lib/python3.5/site-packages/tensorflow/contrib/data/python/ops/prefetching_ops.py", line 25, in <module>
    resource_loader.get_path_to_datafile("../../_prefetching_ops.so"))
  File "/home/pi/tensor/lib/python3.5/site-packages/tensorflow/contrib/util/loader.py", line 55, in load_op_library
    ret = load_library.load_op_library(path)
  File "/home/pi/tensor/lib/python3.5/site-packages/tensorflow/python/framework/load_library.py", line 56, in load_op_library
    lib_handle = py_tf.TF_LoadLibrary(library_filename, status)
  File "/home/pi/tensor/lib/python3.5/site-packages/tensorflow/python/framework/errors_impl.py", line 473, in __exit__
    c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.NotFoundError: /home/pi/tensor/lib/python3.5/site-packages/tensorflow/contrib/data/python/ops/../../_prefetching_ops.so: undefined symbol: _ZN6google8protobuf8internal26fixed_address_empty_stringE

I have no idea what's wrong and how to resolve this. Could you help?

varun19299 commented 6 years ago

Did you try reinstalling google protobuf? I'm interpreting this from your error.

Also, could you specifiy the wheel (from Jenkins nightly RPI zero builds) that you have used? I'll try replicating the issue.

stmkjp commented 6 years ago

Hi @varun19299 ,

no, I didn't try reinstalling google protobuf manually.

From fresh installation of debian on rpi zero,

1) I built opencv 3.3.1 on pi zero following this instruction: https://www.pyimagesearch.com/2017/09/04/raspbian-stretch-install-opencv-3-python-on-your-raspberry-pi/

2) downloaded and installed tensorflow wheel from http://ci.tensorflow.org/view/Nightly/job/nightly-pi-zero-python3/72/ , on python3.5 venv activated. (I had to rename the wheel file from tensorflow-1.4.0-cp34-none-any.whl to tensorflow-1.4.0-cp35-none-any.whl )

3) installed cython through pip 3) after that, I git cloned https://github.com/thtrieu/darkflow.git and build with python setup.py build_ext --inplace

4) tried ./flow --imgdir=sample_img --model cfg/tiny-yolo-voc.cfg --load bin/tiny-yolo-voc.weights --gpu 0 with no joy.

abagshaw commented 6 years ago

@stmkjp If you haven't already, can you try uninstalling and then reinstalling the protobuf package?

ps3btc commented 6 years ago

@stmkjp did you figure this out?