lissyx
((slow to reply) [NOT PROVIDING SUPPORT])
#36
ah that might come from newer releases of multistrap. Often, I just copy the keys from my host system, /etc/apt/trusted.gpg.d/ into the multistrap directory’s /DeepSpeech/multistrap-raspbian64-stretch/etc/apt/trusted.gpg.d/
Why do you force -a aarch64, it should not be needed? Also the -d is the sysroot target, so should just be /DeepSpeech/multistrap-raspbian64-stretch/
followed by other steps did the trick. deepspeech is compiled and it works in target. This is really very good news. However, final step of building wheel has some issue. Wheel got built successfully and even got installed in my S912 box. But client.py execution gives some error like
sekar@aml:~/deepspeech/bin/v0.3.0$ python3 client.py --model ./models/output_graph.pbmm --alphabet ./models/alphabet.txt --lm ./models/lm.binary --trie ./models/trie --audio ./LDC93S1.wav
Traceback (most recent call last):
File “/home/sekar/.local/lib/python3.6/site-packages/deepspeech/impl.py”, line 14, in swig_import_helper
return importlib.import_module(mname)
File “/usr/lib/python3.6/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 994, in _gcd_import
File “”, line 971, in _find_and_load
File “”, line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named ‘deepspeech._impl’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “client.py”, line 12, in
from deepspeech import Model, printVersions
File “/home/sekar/.local/lib/python3.6/site-packages/deepspeech/init.py”, line 4, in
from deepspeech.impl import AudioToInputVector as audioToInputVector
File “/home/sekar/.local/lib/python3.6/site-packages/deepspeech/impl.py”, line 17, in
_impl = swig_import_helper()
File “/home/sekar/.local/lib/python3.6/site-packages/deepspeech/impl.py”, line 16, in swig_import_helper
return importlib.import_module(’_impl’)
File “/usr/lib/python3.6/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named ‘_impl’
sekar@aml:~/deepspeech/bin/v0.3.0$
I am going to start right from rebuilding docker to enure,
Target is bionic, instead of stretch by creating a multistrap conf for target bionic with libpython3.6 instead of 3.5, Let me try this.
However as seen earlier all issues were fixed by simple configs, if you have any idea will be great.
lissyx
((slow to reply) [NOT PROVIDING SUPPORT])
#38
Traceback (most recent call last):
File “/home/sekar/.local/lib/python3.6/site-packages/deepspeech/impl.py”, line 14, in swig_import_helper
return importlib.import_module(mname)
File “/usr/lib/python3.6/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 994, in _gcd_import
File “”, line 971, in _find_and_load
File “”, line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named ‘deepspeech._impl’
During handling of the above exception, another exception occurred:
lissyx
((slow to reply) [NOT PROVIDING SUPPORT])
#42
Ok, that might be my fault. Check the logs when you build the wheel, but I’m sure you see an error / warning about some “ldd” not being found.
You should do someting like: cp "native_client/xldd" "${toolchain}ldd" && chmod +x "${toolchain}ldd" so that there’s a ldd binary in your toolchain (tensorflow side)
Check what maybe_install_xldd does in tc-tests-utils.sh you need to do the same
lissyx
((slow to reply) [NOT PROVIDING SUPPORT])
#43
We rely on ldd to detect deps to copy into the wheel, and default toolchains don’t have it. You can see that there is no libdeepspeech.so inside you wheel, while there should be one
export DS_DSDIR=/DeepSpeech
export DS_TFDIR=/tensorflow
export SYSTEM_TARGET=rpi3-armv8
toolchain=$(make -s -C ${DS_DSDIR}/native_client/ TARGET=${SYSTEM_TARGET} TFDIR=${DS_TFDIR} print-toolchain)
if [ ! -x "${toolchain}ldd" ]; then
cp "${DS_DSDIR}/native_client/xldd" "${toolchain}ldd" && chmod +x "${toolchain}ldd"
fi
after above, found /tensorflow/bazel-tensorflow/external/LinaroAarch64Gcc72/bin/aarch64-linux-gnu-ldd added. Now zlib info has libdeepspeech.so inside the whl.
But still having same error. Is there any other step? As mentioned earlier, I am finding cpython-36m-x86_64-linux-gnu.so. Is it something we need to worry?
lissyx
((slow to reply) [NOT PROVIDING SUPPORT])
#46
No, don’t worry about that. Can you ensure you did properly reinstall the new wheels ? pip install --upgrade ...
Or even pip uninstall deepspeech then redo pip install deepspeech
Yes. That I am sure, because, if I uninstall deepspeech, in that list I can see /home/sekar/.local/lib/python3.6/site-packages/deepspeech/lib/libdeepspeech.so getting uninstalled.
lissyx
((slow to reply) [NOT PROVIDING SUPPORT])
#48
Right. Can you LD_DEBUG=libs python -c "from deepspeech import Model"
lissyx
((slow to reply) [NOT PROVIDING SUPPORT])
#49
Oh wait. x86_64, should not have that.
lissyx
((slow to reply) [NOT PROVIDING SUPPORT])
#50
@sekarpdkt Can you share how you did the make -C python/ TARGET=rpi3-armv8 bindings ? And the build log ?
MANIFEST.in
SRC_FILE=temp_build/deepspeech/.so; TARGET_LIB_DIR=temp_build/deepspeech/lib; MANIFEST_IN=MANIFEST.in; echo “Analyzing $SRC_FILE copying missing libs to $SRC_FILE”; echo “Maybe outputting to $MANIFEST_IN”; (mkdir $TARGET_LIB_DIR || true); missing_libs=""; for lib in $SRC_FILE; do if [ “Linux” = “Darwin” ]; then new_missing="$( (for f in $(otool -L $lib 2>/dev/null | tail -n +2 | awk ‘{ print $1 }’ | grep -v ‘$lib’); do ls -hal $f; done;) 2>&1 | grep ‘No such’ | cut -d’:’ -f2 | xargs basename -a)"; missing_libs="$missing_libs $new_missing"; else missing_libs="$missing_libs $(/tensorflow/bazel-tensorflow/external/LinaroAarch64Gcc72/bin/aarch64-linux-gnu-ldd --root /DeepSpeech/multistrap-raspbian64-stretch/ $lib | grep ‘not found’ | awk ‘{ print $1 }’)"; fi; done; for missing in $missing_libs; do find /tensorflow/bazel-bin/ -type f -name “$missing” -exec cp {} $TARGET_LIB_DIR ; ; if [ ! -z “$MANIFEST_IN” ]; then echo “include $TARGET_LIB_DIR/$missing” >> $MANIFEST_IN; fi; done; if [ “Linux” = “Darwin” ]; then for lib in $SRC_FILE; do for dep in $( (for f in $(otool -L $lib 2>/dev/null | tail -n +2 | awk ‘{ print $1 }’ | grep -v ‘$lib’); do ls -hal $f; done;) 2>&1 | grep ‘No such’ | cut -d’:’ -f2 ); do dep_basename=$(basename “$dep”); install_name_tool -change “$dep” “@rpath/$dep_basename” “$lib”; done; done; fi;
Analyzing temp_build/deepspeech/.so copying missing libs to temp_build/deepspeech/.so
Maybe outputting to MANIFEST.in
cat MANIFEST.in
include temp_build/deepspeech/lib/libdeepspeech.so
rm temp_build/_wrap.o
AS=/tensorflow/bazel-tensorflow/external/LinaroAarch64Gcc72/bin/aarch64-linux-gnu-as CC=/tensorflow/bazel-tensorflow/external/LinaroAarch64Gcc72/bin/aarch64-linux-gnu-gcc CXX=/tensorflow/bazel-tensorflow/external/LinaroAarch64Gcc72/bin/aarch64-linux-gnu-c++ LD=/tensorflow/bazel-tensorflow/external/LinaroAarch64Gcc72/bin/aarch64-linux-gnu-ld CFLAGS="-march=armv8-a -mtune=cortex-a53 -D_GLIBCXX_USE_CXX11_ABI=0 --sysroot /DeepSpeech/multistrap-raspbian64-stretch " LDFLAGS="-Wl,–no-as-needed ‘-Wl,-rpath,$ORIGIN/lib/’ -Wl,-rpath,$ORIGIN" MODEL_LDFLAGS="-L/tensorflow/bazel-bin/native_client " MODEL_LIBS="-ldeepspeech " PYTHONPATH=/DeepSpeech/multistrap-raspbian64-stretch/usr/lib/python3.6/:/DeepSpeech/multistrap-raspbian64-stretch/usr/lib/python3.6/plat-aarch64-linux-gnu/:/DeepSpeech/multistrap-raspbian64-stretch/usr/lib/python3/dist-packages/ NUMPY_INCLUDE=/DeepSpeech/multistrap-raspbian64-stretch/usr/include/python3.5/ python ./setup.py bdist_wheel --plat-name linux_aarch64
/usr/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: ‘long_description_content_type’
warnings.warn(msg)
/usr/local/lib/python3.6/dist-packages/setuptools/dist.py:388: UserWarning: Normalizing ‘0.4.0-alpha.0’ to ‘0.4.0a0’
normalized_version,
running bdist_wheel
running build
running build_ext
running build_py
file deepspeech.py (for module deepspeech) not found
copying ./init.py -> temp_build/deepspeech
copying ./client.py -> temp_build/deepspeech
copying ./impl.py -> temp_build/deepspeech
file deepspeech.py (for module deepspeech) not found
running egg_info
creating deepspeech.egg-info
writing deepspeech.egg-info/PKG-INFO
writing dependency_links to deepspeech.egg-info/dependency_links.txt
writing entry points to deepspeech.egg-info/entry_points.txt
writing requirements to deepspeech.egg-info/requires.txt
writing top-level names to deepspeech.egg-info/top_level.txt
writing manifest file ‘deepspeech.egg-info/SOURCES.txt’
file deepspeech.py (for module deepspeech) not found
reading manifest file ‘deepspeech.egg-info/SOURCES.txt’
reading manifest template ‘MANIFEST.in’
writing manifest file ‘deepspeech.egg-info/SOURCES.txt’
installing to temp_build
running install
running install_lib
running install_egg_info
Copying deepspeech.egg-info to temp_build/deepspeech-0.4.0a0-py3.6.egg-info
running install_scripts
creating temp_build/deepspeech-0.4.0a0.dist-info/WHEEL
creating ‘/DeepSpeech/native_client/python/dist/deepspeech-0.4.0a0-cp36-cp36m-linux_aarch64.whl’ and adding ‘.’ to it
adding ‘deepspeech/init.py’
adding ‘deepspeech/_impl.cpython-36m-x86_64-linux-gnu.so’
adding ‘deepspeech/client.py’
adding ‘deepspeech/impl.py’
adding ‘deepspeech/lib/libdeepspeech.so’
adding ‘deepspeech-0.4.0a0.dist-info/entry_points.txt’
adding ‘deepspeech-0.4.0a0.dist-info/top_level.txt’
adding ‘deepspeech-0.4.0a0.dist-info/WHEEL’
adding ‘deepspeech-0.4.0a0.dist-info/METADATA’
adding ‘deepspeech-0.4.0a0.dist-info/RECORD’
removing temp_build
make: Leaving directory ‘/DeepSpeech/native_client/python’
root@a335dbee69e1:/DeepSpeech/native_client# zipinfo -l python/dist/deepspeech-0.4.0a0-cp36-cp36m-linux_aarch64.whl
Archive: python/dist/deepspeech-0.4.0a0-cp36-cp36m-linux_aarch64.whl
Zip file size: 16310681 bytes, number of entries: 10
-rw-r–r-- 2.0 unx 1670 b- 509 defN 18-Nov-26 03:07 deepspeech/init.py
-rwxr-xr-x 2.0 unx 253336 b- 90331 defN 18-Nov-27 00:35 deepspeech/_impl.cpython-36m-x86_64-linux-gnu.so
-rw-r–r-- 2.0 unx 4355 b- 1735 defN 18-Nov-26 03:07 deepspeech/client.py
-rw-r–r-- 2.0 unx 4509 b- 1351 defN 18-Nov-27 00:35 deepspeech/impl.py
-r-xr-xr-x 2.0 unx 75759552 b- 16206431 defN 18-Nov-27 00:35 deepspeech/lib/libdeepspeech.so
-rw-r–r-- 2.0 unx 55 b- 48 defN 18-Nov-27 00:35 deepspeech-0.4.0a0.dist-info/entry_points.txt
-rw-r–r-- 2.0 unx 11 b- 13 defN 18-Nov-27 00:35 deepspeech-0.4.0a0.dist-info/top_level.txt
-rw-r–r-- 2.0 unx 105 b- 101 defN 18-Nov-27 00:35 deepspeech-0.4.0a0.dist-info/WHEEL
-rw-r–r-- 2.0 unx 24278 b- 8188 defN 18-Nov-27 00:35 deepspeech-0.4.0a0.dist-info/METADATA
-rw-r–r-- 2.0 unx 860 b- 528 defN 18-Nov-27 00:35 deepspeech-0.4.0a0.dist-info/RECORD
10 files, 76048731 bytes uncompressed, 16309235 bytes compressed: 78.6%
root@a335dbee69e1:/DeepSpeech/native_client#
lissyx
((slow to reply) [NOT PROVIDING SUPPORT])
#52
Okay, can you explain me how Python 3.6 gets on that distro ? The cpython x86_64 references are likely because pulling the wrong headers somewhere, and that’s related to Python’s installation (hence why we only support 3.5 on ARMbian).
lissyx
((slow to reply) [NOT PROVIDING SUPPORT])
#54
That’s wrong, I remember doing that explicitely on purpose, because numpy was placing its headers in python3.5 directory even with python 3.6
lissyx
((slow to reply) [NOT PROVIDING SUPPORT])
#55
Only clue that it gives is that there is something wrong somewhere. Now I cannot tell what, since you diverge from what we support ; but it’s not picking the right arch.