ModuleNotFoundError: No module named 'tflite_runtime'

See original GitHub issue

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:

$ python3 classify_image.py --model models/mobilenet_v2_1.0_224_inat_bird_quant_edgetpu.tflite --labels models/inat_bird_labels.txt --input images/parrot.jpg
Traceback (most recent call last):
  File "classify_image.py", line 36, in <module>
    import tflite_runtime.interpreter as tflite
ModuleNotFoundError: No module named 'tflite_runtime'

Does anybody have an idea what the issue could be and how it can be fixed?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
Namburgercommented, Apr 13, 2020

@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?

1reaction
Namburgercommented, Apr 14, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ModuleNotFoundError: No module named 'tflite_runtime'
This error means that Tensorflow Lite has not been installed. To install it, follow the instructions on the official site:.
Read more >
ModuleNotFoundError: No module named 'tflite_runtime'
Hi, I am working a x86 Laptop and have installed tensorflow using https://www.tensorflow.org/lite/guide/python Following is the list of ...
Read more >
tflite-runtime - PyPI
TensorFlow Lite is the official solution for running machine learning models on mobile and embedded devices. It enables on-device machine learning inference ...
Read more >
ModuleNotFoundError: No module named 'tflite_runtime' colab
ModuleNotFoundError : No module named 'tflite_runtime' colab. Add Answer | View In TPC Matrix. Technical Problem Cluster First Answered On July 16, ...
Read more >
Quickstart for Linux-based devices with Python | TensorFlow Lite
Run an inference using tflite_runtime. Instead of importing Interpreter from the tensorflow module, you now need to import it from ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found