tensorflow / fold

Deep learning with dynamic computation graphs in TensorFlow
Apache License 2.0
1.82k stars 266 forks source link

Fold not loading after custom compilation #65

Open rcilla opened 7 years ago

rcilla commented 7 years ago

I have succesfully compiled tensorflow r1.1 and fold in my linux machine with gcc-4.9 but python is not able to load tensorflow:

>>> import tensorflow_fold as fd
2017-05-29 11:40:45.075279: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:901] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2017-05-29 11:40:45.075584: I tensorflow/core/common_runtime/gpu/gpu_device.cc:887] Found device 0 with properties: 
name: GeForce GTX 1060 6GB
major: 6 minor: 1 memoryClockRate (GHz) 1.759
pciBusID 0000:01:00.0
Total memory: 5.92GiB
Free memory: 5.33GiB
2017-05-29 11:40:45.075597: I tensorflow/core/common_runtime/gpu/gpu_device.cc:908] DMA: 0 
2017-05-29 11:40:45.075601: I tensorflow/core/common_runtime/gpu/gpu_device.cc:918] 0:   Y 
2017-05-29 11:40:45.075606: I tensorflow/core/common_runtime/gpu/gpu_device.cc:977] Creating TensorFlow device (/gpu:0) -> (device: 0, name: GeForce GTX 1060 6GB, pci bus id: 0000:01:00.0)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/rcilla/code/foldenv/local/lib/python2.7/site-packages/tensorflow_fold/__init__.py", line 22, in <module>
    from tensorflow_fold.blocks.block_compiler import *
  File "/home/rcilla/code/foldenv/local/lib/python2.7/site-packages/tensorflow_fold/blocks/block_compiler.py", line 28, in <module>
    from tensorflow_fold.blocks import loom_ops
  File "/home/rcilla/code/foldenv/local/lib/python2.7/site-packages/tensorflow_fold/blocks/loom_ops.py", line 19, in <module>
    import tensorflow_fold.blocks.result_types as tdt
  File "/home/rcilla/code/foldenv/local/lib/python2.7/site-packages/tensorflow_fold/blocks/result_types.py", line 27, in <module>
    from tensorflow_fold.public import loom
  File "/home/rcilla/code/foldenv/local/lib/python2.7/site-packages/tensorflow_fold/public/loom.py", line 17, in <module>
    from tensorflow_fold.loom.loom import *
  File "/home/rcilla/code/foldenv/local/lib/python2.7/site-packages/tensorflow_fold/loom/__init__.py", line 17, in <module>
    from tensorflow_fold.loom.loom import *
  File "/home/rcilla/code/foldenv/local/lib/python2.7/site-packages/tensorflow_fold/loom/loom.py", line 36, in <module>
    from tensorflow_fold.loom import deserializing_weaver_op
  File "/home/rcilla/code/foldenv/local/lib/python2.7/site-packages/tensorflow_fold/loom/deserializing_weaver_op.py", line 34, in <module>
    tf.resource_loader.get_data_files_path(), '_deserializing_weaver_op.so'))
  File "/home/rcilla/code/foldenv/local/lib/python2.7/site-packages/tensorflow/python/framework/load_library.py", line 64, in load_op_library
    None, None, error_msg, error_code)
tensorflow.python.framework.errors_impl.NotFoundError: /home/rcilla/code/foldenv/local/lib/python2.7/site-packages/tensorflow_fold/loom/_deserializing_weaver_op.so: undefined symbol: _ZN10tensorflow7strings6StrCatB5cxx11ERKNS0_8AlphaNumE

Note the symbol not found is different from the one reported in #57

rcilla commented 7 years ago

I just found that when compiling tensorflow with gcc 6.3.0 - without cuda support - the error is not produced. It only appears when compiling wiht gcc-4.9 and cuda support

ronghanghu commented 7 years ago

_ZN10tensorflow7strings6StrCatB5cxx11ERKNS0_8AlphaNumE

Looks like tensorflow::strings::StrCat is missing. This error seems to come from the string interface change in GCC from GCC 4.x to 5.x.

https://developers.redhat.com/blog/2015/02/05/gcc5-and-the-c11-abi/