pythonpiptpugoogle-coral

Installing Coral Edge TPU software gives me "ModuleNotFoundError: No module named 'pycoral.adapters'" error


I am trying to install the Coral Edge TPU software on MacOS 11.5 by following these instructions:

https://coral.ai/docs/accelerator/get-started/#3-run-a-model-on-the-edge-tpu

But by the time I enter the following command into the console:

python3 examples/classify_image.py --model test_data/mobilenet_v2_1.0_224_inat_bird_quant_edgetpu.tflite --labels test_data/inat_bird_labels.txt --input test_data/parrot.jpg

I get the following error:

Traceback (most recent call last):
  File "/Users/fabrizio/Desktop/work/MagneticChessResearch/machine learning/Coral/edgetpu_runtime/coral/pycoral/examples/classify_image.py", line 36, in <module>
    from pycoral.adapters import classify
ModuleNotFoundError: No module named 'pycoral.adapters'

Any ideas?


Solution

  • I have the same issue on Windows 10. If you are using Python 3.9.x, and used the command pip3 install --extra-index-url https://google-coral.github.io/py-repo/ pycoral to install pycoral, then you will be installing a very old version of pycoral which does not have pycoral.adapters module. I think this is because the pycoral repo currently (June 2021) does not have the package built for Python 3.9.x.

    The solution is to either build and install pycoral from source on your Mac using Python 3.9.x, or downgrade Python to 3.8.x and install pycoral again.