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 #168

Closed
AldemarMl opened this issue Apr 16, 2017 · 38 comments
Closed

No module named cy_yolo_findboxes #168

AldemarMl opened this issue Apr 16, 2017 · 38 comments

Comments

@AldemarMl
Copy link

when I run demo shows this

darkflow/net/yolo/test.py", line 6, in
from cython_utils.cy_yolo_findboxes import yolo_box_constructor

@abagshaw
Copy link
Collaborator

Have you built the cython module with

cd ./cython_utils
python3 setup.py build_ext --inplace
cd ..

@Abhi001vj
Copy link

Is this only for python 3, i saw in one of the issues someone said about running it on python 2.7.
https://github.com/thtrieu/darkflow/issues/18
can i run this darkflow in python2.7.Great port though,works well with python3 is there any optimum system requirements for this.
Thank you.

@Momotyust
Copy link

The same problem occurred for me. Have anyone solved it? I have tried it on two PCs and built the cython module, but it happened again.

@Momotyust
Copy link

Momotyust commented Apr 20, 2017

@lesthad666
I think it's time to close this issue now if you have solved it. That's my situation and solution:
Just as @abagshaw said, built the cython module with
`
cd ./cython_utils

python3 setup.py build_ext --inplace

cd ..
`
Then pay attention to the file "flow", open this file and modify "#! /usr/bin/env python" to "#! /usr/bin/env python3" , it will work fine.

@eljefedelrodeodeljefe
Copy link

Executing with python3 helped me here. This then requires tensorflow and opencv-python being installed for python3 also.

@eljefedelrodeodeljefe
Copy link

Small correction opencv-python will eventually throw when trying to get camera input due to its imitations. Trying to find a workaround.

@ZZ-yamashita-mg
Copy link

The same problem occurred for me.
In my case, added import pyximport; pyximport.install() to darkflow/net/yolo/test.py line 7.
My resolution is to directly import cy_yolo_findboxes.pyx.

@loretoparisi
Copy link
Contributor

This happens to me when doing

git clone https://github.com/thtrieu/darkflow.git
cd darkflow
pip install .

and then

./flow3 --model bin/yolo.cfg --load bin/yolo.weights --demo samples/video_1.avi --gpu 0.5 --saveVideo
Traceback (most recent call last):
  File "./yolo", line 3, in <module>
    from darkflow.net.build import TFNet
  File "/darkflow/darkflow/darkflow/net/build.py", line 7, in <module>
    from .framework import create_framework
  File "/darkflow/darkflow/darkflow/net/framework.py", line 1, in <module>
    from . import yolo
  File "/darkflow/darkflow/darkflow/net/yolo/__init__.py", line 2, in <module>
    from . import test
  File "/darkflow/darkflow/darkflow/net/yolo/test.py", line 6, in <module>
    from darkflow.cython_utils.cy_yolo_findboxes import yolo_box_constructor
ImportError: No module named 'darkflow.cython_utils.cy_yolo_findboxes'

where flow3 has a modified shebang #! /usr/bin/env python3

while doing with Cython to me does not work at all ending with

cd darkflow/
python3 setup.py build_ext --inplace
Traceback (most recent call last):
  File "setup.py", line 3, in <module>
    from Cython.Build import cythonize
ImportError: No module named 'Cython'

@EmmanouelP
Copy link

you can instal cython by typing in your terminal:

sudo apt-get install cython3

@theamazingdrew
Copy link

I had this problem using the pip / pip3 install method. using Setup.py worked.

@thtrieu
Copy link
Owner

thtrieu commented May 19, 2017

Seems all problems is resolved.

@thtrieu thtrieu closed this as completed May 19, 2017
@benn94
Copy link

benn94 commented Jun 15, 2017

I have encountered the same problem while running

git clone https://github.com/thtrieu/darkflow.git
cd darkflow
python3.5 setup.py build_ext --inplace

This is the output of ./flow --h

$ ./flow
Traceback (most recent call last):
  File "./flow", line 4, in <module>
    from darkflow.cli import cliHandler
  File "/mnt/hdd3t/Data/hci2/borinyun/darkflow/darkflow/cli.py", line 3, in <module>
    from darkflow.net.build import TFNet
  File "/mnt/hdd3t/Data/hci2/borinyun/darkflow/darkflow/net/build.py", line 7, in <module>
    from .framework import create_framework
  File "/mnt/hdd3t/Data/hci2/borinyun/darkflow/darkflow/net/framework.py", line 1, in <module>
    from . import yolo
  File "/mnt/hdd3t/Data/hci2/borinyun/darkflow/darkflow/net/yolo/__init__.py", line 2, in <module>
    from . import predict
  File "/mnt/hdd3t/Data/hci2/borinyun/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

and this is the output of "flow"

$ flow --h
No command 'flow' found, did you mean:
 Command 'flog' from package 'flog' (universe)
 Command 'cflow' from package 'cflow' (universe)
 Command 'flow6' from package 'ipv6toolkit' (universe)
flow: command not found

@abagshaw
Copy link
Collaborator

abagshaw commented Jun 15, 2017

@benn94 The first problem ImportError: No module named cy_yolo_findboxes is indeed a bug I believe. There is already an open PR to address the issue (#273) - I believe the issue is caused by all import paths directly stemming from darkflow instead of using relative paths. If darkflow is installed globally using one of the other two options that use pip (outlined here) then it works just fine, but if it isn't installed globally then these imports fail. The PR makes these imports relative so they should work whether or not darkflow is installed globally. So to temporarily solve your problem, try installing using one of the options that use pip until that PR is merged.

In regards to your second problem, flow will not work unless you install darkflow globally. That's not a bug - that is normal, as building the Cython extensions is not installing darkflow as pip install . does so you won't be able to globally access flow, you'll have to use ./flow when in the darkflow folder.

@benn94
Copy link

benn94 commented Jun 23, 2017

@abagshaw thank you. I have found it is the python version problem. I could run the command flow by just specify the version of my python and instead of running ./flow, it works by just run flow

python3.5 flow --h

@neelkadia-zz
Copy link

I'm having similar issue as @benn94

Traceback (most recent call last):
  File "./flow", line 4, in <module>
    from darkflow.cli import cliHandler
  File "/home/kadia/Documents/darkflow-master/darkflow/cli.py", line 3, in <module>
    from .net.build import TFNet
  File "/home/kadia/Documents/darkflow-master/darkflow/net/build.py", line 7, in <module>
    from .framework import create_framework
  File "/home/kadia/Documents/darkflow-master/darkflow/net/framework.py", line 1, in <module>
    from . import yolo
  File "/home/kadia/Documents/darkflow-master/darkflow/net/yolo/__init__.py", line 2, in <module>
    from . import predict
  File "/home/kadia/Documents/darkflow-master/darkflow/net/yolo/predict.py", line 7, in <module>
    from ...cython_utils.cy_yolo_findboxes import yolo_box_constructor
ImportError: No module named cy_yolo_findboxes

@gaumarjos
Copy link

I encountered the same problem ImportError: No module named 'darkflow.cython_utils.cy_yolo_findboxes' when I'm trying to run the example code in "Using darkflow from another python application".
I'm using python 3 in an Anaconda environment and installed darkflow globally with pip install .

I'd like to try the proposed solution: python3 setup.py build_ext --inplace but I don't see any setup.py in cython_utils. Am I missing something?

@akashjobanputra
Copy link

Same issue as @stesalati . There's no setup.py in cython_utils.

@clitenmestra
Copy link

Executing, from windows 10, "python flow --model cfg / yolo.cfg --load bin / yolo.weights --demo E: \ image \ photos \ abrilsss.wmv --gpu 1.0", I get the same error:
"ImportError: No module named ' darkflow.cython_utils.cy_yolo_findboxes' "
I do not know how to continue because setup.py is not in cython_utils.

@akashjobanputra
Copy link

@clitenmestra execute python setup.py build_ext in darkflow directory. It builds the cython_utils.

@clitenmestra
Copy link

(tensorflow) F:\tut-tf\darkflow>python setup.py build_ext
running build_ext
error: [WinError 2] El sistema no puede encontrar el archivo especificado``

there are not a file named build_ext . Must I download this file? where?

@rlan
Copy link

rlan commented Oct 14, 2017

@clitenmestra Have you installed cython?

@clitenmestra
Copy link

Yes, I have cython and the next code run.

import cython
cython.__version__

'0.25.2'

@akashjobanputra
Copy link

akashjobanputra commented Oct 16, 2017

@clitenmestra

(ML) E:\AkashJ\projects\darkflow - Copy>python setup.py build_ext --inplace
running build_ext
copying build\lib.win-amd64-3.5\darkflow\cython_utils\nms.cp35-win_amd64.pyd -> darkflow\cython_utils
copying build\lib.win-amd64-3.5\darkflow\cython_utils\cy_yolo2_findboxes.cp35-win_amd64.pyd -> darkflow\cython_utils
copying build\lib.win-amd64-3.5\darkflow\cython_utils\cy_yolo_findboxes.cp35-win_amd64.pyd -> darkflow\cython_utils

It does work, what did you use pip or conda to install cython, numpy, mkl ?
I've used --inplace because I already have cython_utils in my system, --inplace will build only for that particular directory, if you're building for whole system then you don't have to use --inplace.

Translating the error, It says The system can not find the specified file., so it does not mean there is not a file named build_ext as you mentioned.

@clitenmestra
Copy link

The same answer using --inplace

(tensorflow) F: \ tut-tf \ darkflow> python setup.py build_ext --inplace
running build_ext
error: [WinError 2] The system can not find the specified file

I have used anaconda for the installation of most packages.

@clitenmestra
Copy link

After reading in your response that a copy of three files was made, I have located them in ANACONDA site_packages darkflow on my computer and I have copied them in cython_utils in my project. From here with some file location correction the command works fine using GPU.
I will go deeper to find out the causes of my bad installation.
Thanks for your interest.

@wossoneri
Copy link

I had the problem too.And I found that my tensorflow was running in virtualenv of python2.7.

Change the virtualenv to python3 could solved this.
Installing tensorflow with virtualenv

@liuhantao9
Copy link

I am still getting this error when I am using Pycharm to execute some code
Here is what I got, Any help will be appreciated. Node: I have done python3 setup.py build_ext --inplace. All the file like cy_yolo_findboxes.c and cy_yolo2_findboxes are all inside the cython_utils folder. But it can not work.
screen shot 2018-01-31 at 11 46 15 pm

@AimoreRRD
Copy link

AimoreRRD commented Feb 5, 2018

I have the same error as liuhantao9. The file is there, and I even added sys.path.append to the right location. But it throws the same error, any ideas?

@liuhantao9
Copy link

The error occurred to me was becuz the version of python, I downgrade the python from 3.6 to 3.5 and solve all the problem.

@kirubeltadesse
Copy link

python3 flow --h
Traceback (most recent call last):
File "flow", line 4, in
from darkflow.cli import cliHandler
File "/home/kirubel/YOLO_Object_Detection/darkflow/cli.py", line 3, in
from .net.build import TFNet
File "/home/kirubel/YOLO_Object_Detection/darkflow/net/build.py", line 3, in
from . import help
File "/home/kirubel/YOLO_Object_Detection/darkflow/net/help.py", line 9, in
import cv2
ImportError: No module named 'cv2'

@tonmoyborah
Copy link

So this doesn't work for python2.7?

@tonmoyborah
Copy link

And the link to guidelines for installing darkflow globally is dead. How do I install darkflow globally?

@ido-ran
Copy link

ido-ran commented May 29, 2018

I had to run the following commands to solve this problem:

sudo pip3 install opencv-python
sudo pip3 install tensorflow

@JoffreyN
Copy link

cd darkflow-master
setup.py build_ext --inplace

Done!

@tripzero
Copy link

For me this was solved by running code outside the darkflow directory. python3 was importing libraries from the local directory which contained pre-built pyx (cython) modules.

from darkflow directory:

python3 -c "from darkflow.net.build import TFNet"
ModuleNotFoundError: No module named 'darkflow.cython_utils.cy_yolo_findboxes'

cd ../
python3 -c "from darkflow.net.build import TFNet"
[success]

@tkaczyk1991
Copy link

Seems all problems is resolved.

All problems certainly are not resolved.

@rahard
Copy link

rahard commented Apr 14, 2019

For me the solution is simple. Look (edit) at file "flow". The first line tries to invoke "python". In my default configuration, "python" means "python2". So I just changed it to "python3" instead of just "python" and it works like a charm.

@GarlandZhang
Copy link

GarlandZhang commented May 13, 2020

I was using jupyter notebook but it wasn't using my anaconda libraries so I switched to command prompt and ran the following:

  1. pip uninstall darkflow then

  2. pip install -e .

And the error was gone.

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