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

ImportError: No module named 'utils.cython_modules.cython_bbox' #2

Open
TreeLLi opened this issue Jan 24, 2018 · 4 comments
Open

ImportError: No module named 'utils.cython_modules.cython_bbox' #2

TreeLLi opened this issue Jan 24, 2018 · 4 comments
Assignees

Comments

@TreeLLi
Copy link

TreeLLi commented Jan 24, 2018

I know this error has been widely discussed and here are some specifications I found for this program.

  1. The default cython binaries in the directory 'Detection/utils/cython_modules/' only support for particular version, 3.4(Linux) and 3.5(Windows), of Python. So anyone who got the error info like the title should checks if your Python version is suitable.

  2. The latest cython module binaries have been updated on the repo of CNTK. But after copying the corresponding binaries for Python 3.5(Linux), i.e. cpu_nms.cpython-35m.so and cython_bbox.cpython-35m.so, into the directory of current project 'Detection/utils/cython_modules/', it still reports the same error as the title during compilation, while the program will run well if I change my Python to 3.4 by Anaconda virtual environment and run the same project, i.e. same directory and same program.

  3. Another solution for this problem is to recompile the above cython modules by ourselves following instructions from CNTK Guide. The lucky thing is that the program can pass the compilation without any error report, while unfortunately it produces/prints some unknown error info during the training.

All of my testing are run on the latest DSVM for Linux.
Default Python: Python 3.5 with CNTK 2.2
Python 3.4 Virtual Environment: Python 3.4 with CNTK 2.1

@TreeLLi
Copy link
Author

TreeLLi commented Jan 24, 2018

For anyone who are troubled by the case 2, i.e. the corresponding binaries have been already put into the proper directory but still get the error of 'Not Found', you should rename the binaries as below:

  1. cpu_nms.cpython-35m.so as cpu_nms.so
  2. cython_bbox.cpython-35m.so as cython_bbox.so

this solution is found from others' discussion

@karolzak
Copy link
Owner

Hi @TreeLLi,

First off, thanks for stoping by! :)
I must say I haven't tested it on Linux really.. I know there used to be some missing Cython modules in CNTK for Linux with Python version different from 3.4 but from what I know they added the modules to original CNTK repo few months ago.
From what I understand from your second comment you already found a solution for that issue.
And I think I know what caused it..
If you take a look at imports of this file in utils/nms:
from utils.cython_modules.cpu_nms import cpu_nms
This line works perfectly on Windows but it seems like it's causing some issues on Linux..

@karolzak karolzak self-assigned this Jan 25, 2018
@TreeLLi
Copy link
Author

TreeLLi commented Jan 26, 2018

Thanks for your explanation.

The problem has been addressed perfectly. But I still think including the latest cython binaries in your directory will be a good idea, since it's not like a problem of missing some external library e.g. easydict. Besides, currently the solution is not such easy to find, for people have to combine the info from CNTK website and others' issue discussion.

So updating the cython module or pointing it out clearly in the Readme file will be super friendly to some beginners specifically for CNTK Faster-RCNN.

@karolzak
Copy link
Owner

karolzak commented Feb 5, 2018

@TreeLLi that's very accurate! Thanks for feedback!
I will add missing cython libraries and I'll try to add some sort of if statement automatically loading up the appropriate cython libs depending on OS and Python version

@TreeLLi TreeLLi closed this as completed Feb 12, 2018
@karolzak karolzak reopened this Feb 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants