beasteers/tflit

Does this library works on armv7l CPU

Opened this issue · 2 comments

Hi,

I'm trying to use this library on an armv7l CPU (Raspberry Pi 4B 32-bit) but I'm not able to install it properly.
The environment is a Debian Buster with Python 3.7.3 and pip 21.3.1.

The same code works fine on Raspberry Pi 4B 64-bit (aarch64).

This is the trace I got from pip:

#10 139.6 Collecting tflit
#10 139.7   Downloading tflit-0.1.2.tar.gz (13 kB)
#10 139.8   Preparing metadata (setup.py): started
#10 151.0   Preparing metadata (setup.py): finished with status 'error'
#10 151.0   ERROR: Command errored out with exit status 1:
#10 151.0    command: /opt/mycroft-venv/bin/python3 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-dfw63k4k/tflit_b759df52bc674fd79b366d842d7c260c/setup.py'"'"'; __file__='"'"'/tmp/pip-install-dfw63k4k/tflit_b759df52bc674fd79b366d842d7c260c/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-nojk5gky
#10 151.0        cwd: /tmp/pip-install-dfw63k4k/tflit_b759df52bc674fd79b366d842d7c260c/
#10 151.0   Complete output (23 lines):
#10 151.0   ERROR: Cannot install tflite-runtime==2.5.0 and tflite-runtime==2.5.0.post1 because these package versions have conflicting dependencies.
#10 151.0   ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies
#10 151.0   No module named 'tflite_runtime' installing the right version for your system now...
#10 151.0   Traceback (most recent call last):
#10 151.0     File "/tmp/pip-install-dfw63k4k/tflit_b759df52bc674fd79b366d842d7c260c/tflit/tflite_install.py", line 31, in check_install
#10 151.0       import tflite_runtime
#10 151.0   ModuleNotFoundError: No module named 'tflite_runtime'

Let me know if you need more details.

If I install tflite_runtime prior tflit then the installation on armv7l works.

Hmmmmm this should absolutely be working on arm because I built it for raspberry pi's.

There is a weird thing where we have to call pip install ... tflite_runtime inside of tflit's setup.py (or on first import) because tensorflow hasn't released to pypi (for some reason).

It looks like it's complaining about a version conflict (tflite-runtime==2.5.0 and tflite-runtime==2.5.0.post1), but I don't understand where that is coming from. Like why is it trying both versions...

Thanks for submitting the issue. I'll have to look into this more!


Here's the code where it says it's failing.

def check_install(verbose=False, upgrade=False, force=False, **kw):
    ...
    try:
        import tflite_runtime  # here's where it's failing
    except ImportError as e:  # this 
        ...

It's strange because this output should be suppressed ModuleNotFoundError: No module named 'tflite_runtime' and this line (No module named 'tflite_runtime' installing the right version for your system now...) means that the error was caught....