Closed cburgdorfer closed 4 years ago
Do you know where the tflite_runtime package was installed? It may just not be presented in your python path. Please show me the outputs of this command:
$ python3 -m pip show --verbose tflite-runtime
And
$ python3 -c 'print(__import__("sys").path)'
Thanks for your quick response, and your offer to help! Much appreciated! The first command outputs nothing, the second provides a bunch of paths.
$ python3 -m pip show --verbose tflite-runtime
$ python3 -c 'print(__import__("sys").path)'
['', '/Users/cburgdorfer/miniconda3/lib/python37.zip', '/Users/cburgdorfer/miniconda3/lib/python3.7', '/Users/cburgdorfer/miniconda3/lib/python3.7/lib-dynload', '/Users/cburgdorfer/miniconda3/lib/python3.7/site-packages']
$
@cburgdorfer Sorry, was in a meeting. First command outputs nothing either means that you don't have it installed or you have multiple python version installed and only 1 of it knows? For macOS with python3.7.3, you should be using this:
$ python3 -m pip install https://dl.google.com/coral/python/tflite_runtime-2.1.0.post1-cp37-cp37m-macosx_10_14_x86_64.whl
Can you try that again, take notes of the outputs to make sure we know where it's installed?
Thanks again, @Namburger , I have found out what the problem was thanks to your comment:
The documentation says I should run the pip install ...
command, but thanks to your comment, I've found out, I need to call python3 -m pip install ...
This was the output accordingly:
$ python3 -m pip install https://dl.google.com/coral/python/tflite_runtime-2.1.0.post1-cp37-cp37m-macosx_10_14_x86_64.whl
Collecting tflite-runtime==2.1.0.post1 from https://dl.google.com/coral/python/tflite_runtime-2.1.0.post1-cp37-cp37m-macosx_10_14_x86_64.whl
Using cached https://dl.google.com/coral/python/tflite_runtime-2.1.0.post1-cp37-cp37m-macosx_10_14_x86_64.whl
Requirement already satisfied: numpy>=1.12.1 in /Users/cburgdorfer/miniconda3/lib/python3.7/site-packages (from tflite-runtime==2.1.0.post1) (1.16.4)
Installing collected packages: tflite-runtime
Successfully installed tflite-runtime-2.1.0.post1
Thanks again! Much appreciated!
Ahh I see confusion, your pip is most likely pip2 and not pip3, so then when your python3 try to load the package, it couldn't find it lol
Edit: To clarify,
$ python3 -m pip install ...
is the same as
$ pip install
But only if your default pip is pip3. if you have pip2 as default, when you do a pip install
, it's equivalent to:
$ python2 -m pip install ...
In general, we document pip install because that's what people used to. But for me explicit is always better and more "secure" so I go with python3 -m pip install
.
After following the instructions on https://coral.ai/docs/accelerator/get-started/#on-mac, I get the following error on macOS 10.15, python 3.7.3:
Does anybody have an idea what the issue could be and how it can be fixed?