google-coral / pycoral

Python API for ML inferencing and transfer-learning on Coral devices
https://coral.ai
Apache License 2.0
351 stars 145 forks source link

Make Python Wheels for Centos 7 #21

Open apdullahyayik opened 3 years ago

apdullahyayik commented 3 years ago

This is issue aims to report that Python 3.8 wheels, below for Linux 64 bit, has problems at Centos 7 when importing the interpreter of TensorFlow-lite runtime.

https://github.com/google-coral/pycoral/releases/download/v1.0.1/tflite_runtime-2.5.0-cp38-cp38-linux_x86_64.whl

import tflite_runtime.interpreter Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.8/site-packages/tflite_runtime/interpreter.py", line 36, in from tflite_runtime import _pywrap_tensorflow_interpreter_wrapper as _interpreter_wrapper ImportError: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /usr/local/lib/python3.8/site-packages/tflite_runtime/_pywrap_tensorflow_interpreter_wrapper.cpython-38-x86_64-linux-gnu.so)

I have cloned the project as described in the readme.md and run the command below an error related to the docker image is raised: $ ./script/build.sh

Is there anyone that can explain how to run build.sh to create Python wheels for Centos 7?

Namburger commented 3 years ago

@apdullahyayik Here is the instruction for building the tflite_runtime package: https://github.com/tensorflow/tensorflow/tree/master/tensorflow/lite/tools/pip_package If you build it the the same machine that you are intending to use the package on, then the glibc version should be a perfect match!

apdullahyayik commented 3 years ago

Thank you @Namburger .

But there may be a problem with the scripts. It is explained below.

This command raises an error related to make function setup.py.

command= $ sudo sh ./tensorflow/lite/tools/pip_package/build_pip_package.sh

error= subprocess.CalledProcessError: Command '['make', 'SHELL=/bin/bash', 'BUILD_WITH_NNAPI=false', '-C', '/home/osboxes/Desktop/issue/tf/tensorflow/tensorflow/lite/tools/pip_package/../../../..', '-f', 'tensorflow/lite/tools/make/Makefile', '-j', '1']' returned non-zero exit status 2.

Note that I have already installed the recommended dependencies at setup.py/make function (which are the same packages in the md file) swig libjpeg-dev zlib1g-dev python3-dev python3-nump