Search code examples
pythonobject-detectionyolodarknet

Python no module named 'darkflow.cython_utils.cy_yolo_findboxes


i am working on darknet yolov2 for object detection . I have used pip install . which is use to compile the darkflow library. after that when the darkflow is successfully installed.

from darkflow.net.build import TFNet
import cv2

options = {"model": "cfg/yolo.cfg", "load": "bin/yolov2.weights", "threshold": 0.1}

tfnet = TFNet(options)

imgcv = cv2.imread("./sample_img/sample_dog.jpg")
result = tfnet.return_predict(imgcv)
print(result)

i got this error .

enter image description here

C:\Users\IU-506\Anaconda3\lib\site-packages\h5py\__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters

further these are also errors please review this:

ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-1-1bd33c7e6a6f> in <module>()
----> 1 from darkflow.net.build import TFNet
      2 import cv2
      3 
      4 options = {"model": "cfg/yolo.cfg", "load": "bin/yolov2.weights", "threshold": 0.1}
      5 

~\Desktop\darkflow-master\darkflow\net\build.py in <module>()
      5 from .ops import op_create, identity
      6 from .ops import HEADER, LINE
----> 7 from .framework import create_framework
      8 from ..dark.darknet import Darknet
      9 import json

~\Desktop\darkflow-master\darkflow\net\framework.py in <module>()
----> 1 from . import yolo
      2 from . import yolov2
      3 from . import vanilla
      4 from os.path import basename
      5 

~\Desktop\darkflow-master\darkflow\net\yolo\__init__.py in <module>()
      1 from . import train
----> 2 from . import predict
      3 from . import data
      4 from . import misc
      5 import numpy as np

~\Desktop\darkflow-master\darkflow\net\yolo\predict.py in <module>()
      5 import os
      6 import json
----> 7 from ...cython_utils.cy_yolo_findboxes import yolo_box_constructor
      8 
      9 def _fix(obj, dims, scale, offs):

ModuleNotFoundError: No module named 'darkflow.cython_utils.cy_yolo_findboxes'

Solution

  • I have solved the problem with the help of following steps:-

    * Make sure your all libraries are installed on the base root

    pip install darknetpy
    

    install the Tensorflow with the help of Anaconda Navigator in the base(root)

    Restart the anaconda