robmarkcole / coral-pi-rest-server

Perform inferencing of tensorflow-lite models on an RPi with acceleration from Coral USB stick
https://coral.ai/products/accelerator
MIT License
67 stars 20 forks source link

requirements.txt needs numpy #30

Closed lmamakos closed 5 years ago

lmamakos commented 5 years ago

I think that requirements.txt needs to include numpy. While starting coral-app.py inside a container with only Flask and Pillow installed I note that something in the edgetpu library has a dependency on it:

root@8d34eb5617d9:/home/pi# python coral-app.py
ImportError: numpy.core.multiarray failed to import
Traceback (most recent call last):
  File "coral-app.py", line 6, in <module>
    from edgetpu.detection.engine import DetectionEngine
  File "/usr/local/lib/python3.6/site-packages/edgetpu/detection/engine.py", line 17, in <module>
    from edgetpu.basic.basic_engine import BasicEngine
  File "/usr/local/lib/python3.6/site-packages/edgetpu/basic/basic_engine.py", line 17, in <module>
    from edgetpu.swig.edgetpu_cpp_wrapper import BasicEnginePythonWrapper
  File "/usr/local/lib/python3.6/site-packages/edgetpu/swig/edgetpu_cpp_wrapper.py", line 28, in <module>
    _edgetpu_cpp_wrapper = swig_import_helper()
  File "/usr/local/lib/python3.6/site-packages/edgetpu/swig/edgetpu_cpp_wrapper.py", line 24, in swig_import_helper
    _mod = imp.load_module('_edgetpu_cpp_wrapper', fp, pathname, description)
  File "/usr/local/lib/python3.6/imp.py", line 243, in load_module
    return load_dynamic(name, filename, file)
  File "/usr/local/lib/python3.6/imp.py", line 343, in load_dynamic
    return _load(spec)
ImportError: numpy.core.multiarray failed to import

Adding that back to requirements.txt resolves this problem.

robmarkcole commented 5 years ago

Thanks https://github.com/robmarkcole/coral-pi-rest-server/commit/91afa0506f8134f59b0ce7e01d240cee60fa0b11