tensorflow / lattice

Lattice methods in TensorFlow
Apache License 2.0
518 stars 94 forks source link

Cannot build with tensorflow installed by Conda #32

Closed yihengli closed 4 years ago

yihengli commented 5 years ago

Hi, would like to confirm if the current tensorflow_lattice is compatible with tensorflow installed with conda?

Reproduce:

NAME="CentOS Linux" VERSION="7 (Core)"

conda create -n test python=3.6
conda activate test
conda install tensorflow=1.11
pip install tensorflow-lattice

Then in the Python env:

import tensorflow
import tensorflow_lattice

while tensorflow can be imported without errors, tensorflow_lattice will throw following errors:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/anaconda3/envs/error/lib/python3.6/site-packages/tensorflow_lattice/__init__.py", line 33, in <module>
    from tensorflow_lattice.python.estimators.calibrated import input_calibration_layer_from_hparams
  File "/usr/local/anaconda3/envs/error/lib/python3.6/site-packages/tensorflow_lattice/python/estimators/calibrated.py", line 24, in <module>
    from tensorflow_lattice.python.lib import pwl_calibration_layers
  File "/usr/local/anaconda3/envs/error/lib/python3.6/site-packages/tensorflow_lattice/python/lib/pwl_calibration_layers.py", line 31, in <module>
    from tensorflow_lattice.python.ops import pwl_calibration_ops
  File "/usr/local/anaconda3/envs/error/lib/python3.6/site-packages/tensorflow_lattice/python/ops/pwl_calibration_ops.py", line 42, in <module>
    '../../cc/ops/_pwl_calibration_ops.so'))
  File "/usr/local/anaconda3/envs/error/lib/python3.6/site-packages/tensorflow/python/framework/load_library.py", line 56, in load_op_library
    lib_handle = py_tf.TF_LoadLibrary(library_filename)
tensorflow.python.framework.errors_impl.NotFoundError: /usr/local/anaconda3/envs/error/lib/python3.6/site-packages/tensorflow_lattice/python/ops/../../cc/ops/_pwl_calibration_ops.so: undefined symbol: _ZN10tensorflow8internal21CheckOpMessageBuilder9NewStringEv

In the same env, it works fine if I install tensorflow from pip instead of `conda.

theoaf commented 3 years ago

I'm getting the same issue.

Works fine as long as I don't conda install anything!