cannot import name 'compute_pycoco_metrics' from 'keras_cv.metrics.coco'

247 views Asked by At

i install keras_cv on macbook M1:

pip install keras_cv

and run this code

import keras_cv

and get this error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/homebrew/lib/python3.10/site-packages/keras_cv/__init__.py", line 21, in <module>
    from keras_cv import callbacks
  File "/opt/homebrew/lib/python3.10/site-packages/keras_cv/callbacks/__init__.py", line 14, in <module>
    from keras_cv.callbacks.pycoco_callback import PyCOCOCallback
  File "/opt/homebrew/lib/python3.10/site-packages/keras_cv/callbacks/pycoco_callback.py", line 18, in <module>
    from keras_cv.metrics.coco import compute_pycoco_metrics
ImportError: cannot import name 'compute_pycoco_metrics' from 'keras_cv.metrics.coco' (/opt/homebrew/lib/python3.10/site-packages/keras_cv/metrics/coco/__init__.py)

How i can fix this?

2

There are 2 answers

0
Sajjad Aemmi On

Clone and install keras_cv yourselfe:

git clone https://github.com/keras-team/keras-cv.git
cd keras-cv
python setup.py install
0
Yantao Xie On

You may need install pycocotools.

$ pip install pycocotools