【问题标题】:Can't import object detection imageai (python)Can\'t import object detection imageai (python)
【发布时间】:2022-12-28 00:01:42
【问题描述】:

I installed imageai,tensorflow,keras in python with pip

i typed this code

from imageai.Detection import ObjectDetection

it shows this error

ModuleNotFoundError: No module named 'keras.layers.advanced_activations'

module versions
imageai - 2.0.2
keras - 2.90
tensorflow - 2.9.1

im running on windows 10 pro

【问题讨论】:

  • You need to update your version of imageai. It's from 3 years ago. pip install -U imageai.

标签: python tensorflow keras imageai


【解决方案1】:

Try to update version ofimageaito new versions. try this

【讨论】:

    【解决方案2】:

    As imageai now uses Pytorch in backend, you must install a few library dependencies before installing imageai. Please refer to this link for the same.

    pip install cython pillow>=7.0.0 numpy>=1.18.1 opencv-python>=4.1.2 torch>=1.9.0 --extra-index-url https://download.pytorch.org/whl/cpu torchvision>=0.10.0 --extra-index-url https://download.pytorch.org/whl/cpu pytest==7.1.3 tqdm==4.64.1 scipy>=1.7.3 matplotlib>=3.4.3 mock==4.0.3
    
    pip install imageai --upgrade
    

    Import the Object detection api from imageai

    from imageai.Detection import ObjectDetection
    

    Let us know if the issue still persists. Thank you.

    【讨论】:

      猜你喜欢
      • 2022-11-20
      • 2022-08-09
      • 2022-11-12
      • 2022-08-04
      • 2021-12-30
      • 2022-10-21
      • 1970-01-01
      • 2022-11-14
      • 1970-01-01
      相关资源
      最近更新 更多