llSourcell / YOLO_Object_Detection

This is the code for "YOLO Object Detection" by Siraj Raval on Youtube
GNU General Public License v3.0
1.73k stars 795 forks source link

ModuleNotFoundError: No module named 'nms' #19

Open gdu2003 opened 6 years ago

gdu2003 commented 6 years ago

after building darkflow, i ran command python flow --h and it gave following error.

Traceback (most recent call last): File "flow", line 4, in from darkflow.cli import cliHandler File "D:\ActiveSafety\MyLearning-master\Data\YOLO_Object_Detection-master\dark flow\cli.py", line 3, in from .net.build import TFNet File "D:\ActiveSafety\MyLearning-master\Data\YOLO_Object_Detection-master\dark flow\net\build.py", line 7, in from .framework import create_framework File "D:\ActiveSafety\MyLearning-master\Data\YOLO_Object_Detection-master\dark flow\net\framework.py", line 1, in from . import yolo File "D:\ActiveSafety\MyLearning-master\Data\YOLO_Object_Detection-master\dark flow\net\yolo__init__.py", line 2, in from . import predict File "D:\ActiveSafety\MyLearning-master\Data\YOLO_Object_Detection-master\dark flow\net\yolo\predict.py", line 7, in from ...cython_utils.cy_yolo_findboxes import yolo_box_constructor File "darkflow\cython_utils\cy_yolo_findboxes.pyx", line 1, in init darkflow.c ython_utils.cy_yolo_findboxes import numpy as np ModuleNotFoundError: No module named 'nms'

roy-sourish commented 6 years ago

pip install nms

vscv commented 6 years ago

If use pip install nms will face this...

    from cython_utils.cy_yolo_findboxes import yolo_box_constructor
  File "cy_yolo_findboxes.pyx", line 1, in init cy_yolo_findboxes
AttributeError: module 'nms' has no attribute '__pyx_capi__'

It should be used nms from cython_utils not from pip.

Casp3rBB commented 6 years ago

If use pip install nms will face this...

from cython_utils.cy_yolo_findboxes import yolo_box_constructor

File "cy_yolo_findboxes.pyx", line 1, in init cy_yolo_findboxes AttributeError: module 'nms' has no attribute '__pyx_capi__' It should be used nms from cython_utils not from pip.

can you specify how to install it from cython_utils thanks

satcit commented 5 years ago

Spent ~5 hours on this. For Windows with new virtual environment I had 'no module named nms' error. Solved in two steps: 1) In file setup.py cut name of each Extension to the short one: "darkflow.cython_utils.nms" -> "nms". 2) Step 1 went me to the next error with relative path import error in nms.pyx. Solution I found is to use absolute module path in nms.py line 5: 'darkflow.utils.box' instead of '..utils.box'.

I hope it will help to you too.

little-carrrot-errr commented 4 years ago
  1. download the https://github.com/thtrieu/darkflow
  2. run command :pip install -e . in the project “darkflow”
  3. copy the two folder “darkflow” and “darkflow.egg-info” into our yolo_object_detection project. (replace the original folder "darkflow")
  4. run command : flow --mode cfg/yolo.cfg to test if everything works fine