I'm new to using Tensorflow and need to for a project of mine. The goal is to create a live object recognition system on a RPi4 and I've been stuck in dependency hell. I'm running this on a clean Oraclebox VM that has the RPi4 OS, VSCode and Conda. Tensorflow provides a basic example of this system which I was going to adapt for my project: github.com/tensorflow/examples/blob/master/lite/examples/image_classification/raspberry_pi
I tried running the example code after following installation instructions and received this:
(tflite_env) kerdis01@raspberry:~/examples/lite/examples/image_classification/raspberry_pi $ python classify.py Traceback (most recent call last): File "classify.py", line 21, in <module> from tflite_support.task import core File "/home/kerdis01/miniconda3/envs/tflite_env/lib/python3.8/site-packages/tflite_support/__init__.py", line 48, in <module> from tensorflow_lite_support.metadata.python import metadata File "/home/kerdis01/miniconda3/envs/tflite_env/lib/python3.8/site-packages/tensorflow_lite_support/metadata/python/metadata.py", line 30, in <module> from tensorflow_lite_support.metadata.cc.python import _pywrap_metadata_version ImportError: libusb-1.0.so.0: cannot open shared object file: No such file or directory
Here is my current package list in my env:
# packages in environment at /home/kerdis01/miniconda3/envs/tflite_env:
#
# Name Version Build Channel
libgcc_mutex 0.1 conda_forge conda-forge
openmp_mutex 4.5 2_gnu conda-forge
absl-py 2.1.0 pypi_0 pypi
argparse 1.4.0 pypi_0 pypi
asttokens 2.4.1 pyhd8ed1ab_0 conda-forge
backcall 0.2.0 pyh9f0ad1d_0 conda-forge
ca-certificates 2024.3.11 h06a4308_0
cffi 1.16.0 pypi_0 pypi
comm 0.2.2 pyhd8ed1ab_0 conda-forge
debugpy 1.6.7 py38h6a678d5_0
decorator 5.1.1 pyhd8ed1ab_0 conda-forge
executing 2.0.1 pyhd8ed1ab_0 conda-forge
flatbuffers 20181003210633 pypi_0 pypi
importlib-metadata 7.1.0 pyha770c72_0 conda-forge
importlib_metadata 7.1.0 hd8ed1ab_0 conda-forge
ipykernel 6.29.3 pyhd33586a_0 conda-forge
ipython 8.12.2 pyh41d4057_0 conda-forge
jedi 0.19.1 pyhd8ed1ab_0 conda-forge
jupyter_client 8.6.1 pyhd8ed1ab_0 conda-forge
jupyter_core 5.7.2 py38h578d9bd_0 conda-forge
ld_impl_linux-64 2.38 h1181459_1
libffi 3.4.4 h6a678d5_0
libgcc-ng 13.2.0 h807b86a_5 conda-forge
libgomp 13.2.0 h807b86a_5 conda-forge
libsodium 1.0.18 h36c2ea0_1 conda-forge
libstdcxx-ng 11.2.0 h1234567_1
matplotlib-inline 0.1.6 pyhd8ed1ab_0 conda-forge
ncurses 6.4 h6a678d5_0
nest-asyncio 1.6.0 pyhd8ed1ab_0 conda-forge
numpy 1.24.4 pypi_0 pypi
opencv-python-headless 4.9.0.80 pypi_0 pypi
openssl 3.2.1 hd590300_1 conda-forge
packaging 24.0 pyhd8ed1ab_0 conda-forge
parso 0.8.3 pyhd8ed1ab_0 conda-forge
pexpect 4.9.0 pyhd8ed1ab_0 conda-forge
pickleshare 0.7.5 py_1003 conda-forge
pip 24.0 pypi_0 pypi
platformdirs 4.2.0 pyhd8ed1ab_0 conda-forge
prompt-toolkit 3.0.42 pyha770c72_0 conda-forge
prompt_toolkit 3.0.42 hd8ed1ab_0 conda-forge
protobuf 3.20.3 pypi_0 pypi
psutil 5.9.8 py38h01eb140_0 conda-forge
ptyprocess 0.7.0 pyhd3deb0d_0 conda-forge
pure_eval 0.2.2 pyhd8ed1ab_0 conda-forge
pybind11 2.11.1 pypi_0 pypi
pycparser 2.21 pypi_0 pypi
pygments 2.17.2 pyhd8ed1ab_0 conda-forge
python 3.8.19 h955ad1f_0
python-dateutil 2.9.0 pyhd8ed1ab_0 conda-forge
python_abi 3.8 2_cp38 conda-forge
pyzmq 25.1.2 py38h6a678d5_0
readline 8.2 h5eee18b_0
setuptools 68.2.2 py38h06a4308_0
six 1.16.0 pyh6c4a22f_0 conda-forge
sounddevice 0.4.6 pypi_0 pypi
sqlite 3.41.2 h5eee18b_0
stack_data 0.6.2 pyhd8ed1ab_0 conda-forge
tflite-support 0.4.3 pypi_0 pypi
tk 8.6.12 h1ccaba5_0
tornado 6.4 py38h01eb140_0 conda-forge
traitlets 5.14.2 pyhd8ed1ab_0 conda-forge
typing_extensions 4.10.0 pyha770c72_0 conda-forge
wcwidth 0.2.13 pyhd8ed1ab_0 conda-forge
wheel 0.41.2 py38h06a4308_0
xz 5.4.6 h5eee18b_0
zeromq 4.3.5 h6a678d5_0
zipp 3.17.0 pyhd8ed1ab_0 conda-forge
zlib 1.2.13 h5eee18b_0
I had to change the install script so that opencv-python-headless was installed as that got rid of another error to do with libgl not existing.
Upon googling the issue I found a few potential fixes that I've tried:
sudo apt-get install libusb-1.0-0
sudo apt-get install libusb-1.0-0-dev
But no luck.
I'm trying to keep this build as light as possible but any suggestions would be a great help.