tensorflow/recommenders-addons

Compilation failed (environment exception) with branch master_tf1 and TF1.15.2

shijiexu09 opened this issue · 1 comments

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux
  • TensorFlow version and how it was installed (source or binary): 1.15.2
  • TensorFlow-Recommenders-Addons version and how it was installed (source or binary): source
  • Python version: 3.6
  • Is GPU used? (yes/no): no
  • branch: master_tf1

Describe the bug

The official donot provide release package with TF1.15.2, when i try to compile it by myself, there is a lot of problems such as environment or file format, The details are as follows:

  1. invalid file

invalid options/make_wheel_Linux.sh: line 1: set: -

  1. command not found

tools/testing/build_and_run_tests.sh: line 18: $'\r': command not found

tools/install_so_files.sh: line 2: $'\r': command not found

tools/releases/tf_auditwheel_patch.sh: line 16: $'\r': command not found

  1. not executable

/recommenders-addons/BUILD:1:1: failed to create symbolic link 'build_pip_pkg': file 'build_deps/build_pip_pkg.sh' is not executable

  1. /recommenders-addons/BUILD:1:1: failed to create symbolic link 'build_pip_pkg':

file 'build_deps/build_pip_pkg.sh' is not executable

  1. redis compiling problem(maybe the version of hiredis)

  2. ModuleNotFoundError: No module named 'pip._internal.cli.main'

  3. AttributeError: module 'pkg_resources' has no attribute 'DistributionNotFound'

How to solve

  • Convert file format from dos to unix
dos2unix .github/workflows/make_wheel_Linux.sh
dos2unix tools/testing/build_and_run_tests.sh
dos2unix tools/install_so_files.sh
dos2unix tools/releases/tf_auditwheel_patch.sh
  • Modify file permissions
chmod +x build_deps/build_pip_pkg.sh
  • Donot use redis(sorry for that, but I don't have time to work on this problem in the near recently(maybe next time to solve it), and thanks for the tips from haidong(rhdong) which guide me to solve this problem quickly)

Comment the redis related code in the following files:

tensorflow_recommenders_addons/dynamic_embedding/core/BUILD
tensorflow_recommenders_addons/dynamic_embedding/__init__.py
tensorflow_recommenders_addons/dynamic_embedding/python/ops/BUILD

empty redis related file

>tensorflow_recommenders_addons/dynamic_embedding/python/kernel_tests/redis_table_variable_test.py
  • Install python dependencies in dockerfile
#line 88, tools/docker/build_wheel.Dockerfile
RUN curl https://bootstrap.pypa.io/pip/3.6/get-pip.py -o get-pip.py \
    && python get-pip.py \
    && rm get-pip.py \
    && pip install --upgrade setuptools \
    && pip install /recommenders-addons/wheelhouse/*.whl

Finally, the compilation can be successfully completed with the above measures and thanks for the tips from haidong(rhdong) which guide me to solve these problems quickly.

Closed for being resolved.