Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No module named cy_yolo_findboxes #252

Closed
myBestLove opened this issue May 23, 2017 · 24 comments
Closed

No module named cy_yolo_findboxes #252

myBestLove opened this issue May 23, 2017 · 24 comments

Comments

@myBestLove
Copy link

when I run test , like ./flow --model jason/yolo2_voc2007_2017.cfg --load jason/yolo-voc.weights --test sample_img/
shows:
Traceback (most recent call last): File "./flow", line 4, in <module> from darkflow.cli import cliHandler File "/home/jason/code/darkflow/darkflow/cli.py", line 3, in <module> from darkflow.net.build import TFNet File "/home/jason/code/darkflow/darkflow/net/build.py", line 7, in <module> from .framework import create_framework File "/home/jason/code/darkflow/darkflow/net/framework.py", line 1, in <module> from . import yolo File "/home/jason/code/darkflow/darkflow/net/yolo/__init__.py", line 2, in <module> from . import predict File "/home/jason/code/darkflow/darkflow/net/yolo/predict.py", line 6, in <module> from darkflow.cython_utils.cy_yolo_findboxes import yolo_box_constructor ImportError: No module named cy_yolo_findboxes

there has cy_yolo_findboxes.pyx file in cython_utils directory.
how to sovle? thanks

@abagshaw
Copy link
Collaborator

Have you built the Cython extensions using one of the three methods outlined here?

@myBestLove
Copy link
Author

I only use 'pip install .'

do I need to executed 'python3 setup.py build_ext --inplace' ?

@abagshaw
Copy link
Collaborator

Can you try using flow instead of ./flow

@myBestLove
Copy link
Author

the same problem .

and my cython_utils directory like this
---->cython_utils
---->cy_yolo2_findboxes.pyx
---->init.py
---->nms.pxd
---->cy_yolo_findboxes.pyx
---->init.pyc
---->nms.pyx
is OK?

@abagshaw
Copy link
Collaborator

If you install using pip install . I don't think the Cython extensions will be built in the same folder - they will be build somewhere else. Try running pip uninstall darkflow then run python3 setup.py build_ext --inplace and try the ./flow command again.

@myBestLove
Copy link
Author

ok
I find that if using pip install ., Cython extensions will be built in the /usr/local/lib/python2.7/dist-packages/darkflow.

@ilopezfr
Copy link

ilopezfr commented Jun 3, 2017

@myBestLove I'm having the same issue, using Python 3.5. I tried @abagshaw suggestion but didn't work for me. Can you share how did you solve it? This is a screenshot of my error:
screen shot 2017-06-02 at 7 28 21 pm

@abagshaw
Copy link
Collaborator

abagshaw commented Jun 3, 2017

@ilopezfr Can you try using flow instead of ./flow and see if that changes anything?

@ilopezfr
Copy link

ilopezfr commented Jun 4, 2017

@abagshaw I did my installation using python3 setup.py build_ext --inplace so it doesn't recognize the command flow.
Did you install it globally with pip install . ? Would that chance anything?
Thanks!

@abagshaw
Copy link
Collaborator

abagshaw commented Jun 4, 2017

@ilopezfr It may be that just building the Cython extensions in place doesn't work with the import paths (I'll look into that). For now can you try doing pip install .

@ilopezfr
Copy link

ilopezfr commented Jun 6, 2017

@abagshaw Thanks! It actually fixed it when installing it globally.

@Chambana
Copy link

Chambana commented Aug 20, 2017

For what it's worth, I am using python 2.7 and was having the same issue. I initially used sudo pip install . to install and had the cy_yolo_findboxes error when using the provided python script to import the darkflow module(s). I uninstalled darkflow using "sudo pip uninstall darkflow", then reinstalled using:

python setup.py build_ext --inplace    
(note: not python3 as described  above).  

I now can run the command line demo using:
./flow --model cfg/yolo.cfg --load bin/yolo.weights --demo camera --gpu 1.0

and I can use the python interface as well in python2.7:
from darkflow.net.build import TFNet
import cv2

I'm running ubuntu 16.04, python2.7, CUDA installed. Separate issue, but for whatever reason, the command line demo runs at <1fps.

EDIT: I hadn't activated my virtual environment with GPU-enabled TensorFlow. The demo now runs at 7fps.

@hoardboard
Copy link

Hey,

I had the same issue with the imports from cython code not using fully qualified names. The solution is simply not using "darkflow" as the name for the root folder in the project.

@liuhantao9
Copy link

I am trying to run codes that I wrote on PyCharm, and I ran into same issue.
Any help will be appreciated
screen shot 2018-01-26 at 1 55 29 am

@karthickn210
Copy link

@ilopezfr same errors.... i am also faced using in ubuntu can you help me to overcome this problem with your experience...

@ashokpant
Copy link

cd darkflow/
python setup.py build_ext --inplace
pip install -e .

Works for me (ubuntu16.04, python3.5)

@BaptisteAmato
Copy link

./flow didn't work for me, but python flow ... worked!

@Haosam
Copy link

Haosam commented Oct 11, 2018

after doing all the steps listed,

  • in your conda environment [Either base (if you did not set a virtual environment), OR the virtual environment that you dedicated darkyolo for]
  • go the directory where dark-flow master is located
  • Run 'python3 setup.py build_ext --inplace' again
    OR
    'python setup.py build_ext --inplace' (Depending on your set up)

I was using python 3.5.6 in my anaconda virtual environment and after i built it again, it worked.
After it works
run 'python flow -h' to check after installation.

@GigsyKami
Copy link

GigsyKami commented Feb 22, 2019

i got the same problem but instead ImportError: No module named cy_yolo_findboxes
i got ImportError: No module named cv2
what should i install?
i already do pip install opencv and from here too https://www.lfd.uci.edu/~gohlke/pythonlibs/

@Haosam
Copy link

Haosam commented Feb 24, 2019

Hi GipsyKami. Are you using Conda or the regular python3 for this?

I am assuming you used conda.
There were some issues for me when I installed the packages to link to each other. Somehow for my system, conda installed packages and pip installed packages did not work together. My recommendation when working on yolo for python, is to install all packages on pip.
So, either remove all the conda packages on the conda environment, or just build a new conda environment and pip install the required packages.

As for opencv, it is slightly more complicated than pip install opencv
I followed this installation guide. You can look at it
OpenCV Installation

@akashsahu410
Copy link

screenshot 170

@akashsahu410
Copy link

the same problem .

and my cython_utils directory like this
---->cython_utils
---->cy_yolo2_findboxes.pyx
---->init.py
---->nms.pxd
---->cy_yolo_findboxes.pyx
---->init.pyc
---->nms.pyx
is OK?

@masteroogway97
Copy link

@akashsahu410 Have you tried this?

./flow didn't work for me, but python flow ... worked!

@prsntmaurya
Copy link

Copying the files "nms.pxd" and "nms.pyx" to root darkflow directory worked for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests