HTCN
HTCN copied to clipboard
No module named 'model.utils.cython_bbox'
Hi, I ran python setup.py build develop. But when ran the train code, I got a ModuleNotFoundError of No module named 'model.utils.cython_bbox' the same with Issue I use python3.7.1 but it does not work. My environment is pytorch 1.0.1 and cuda 10.0.130 and python 3.7.1 and cython 0.29.20 and cudnn 7.6.5, and I wonder whether these environments are different.
I've added another extension module in the setup.py
ext_modules = [ extension( "model._C", sources, include_dirs=include_dirs, define_macros=define_macros, extra_compile_args=extra_compile_args, ), extension( "model.utils.cython_bbox", ["model/utils/bbox.pyx"], extra_compile_args={'cxx':[],'gcc': ["-Wno-cpp", "-Wno-unused-function"]}, include_dirs=[numpy_include] ) ]
and now I don't see this issue anymore.
I've added another extension module in the setup.py
ext_modules = [ extension( "model._C", sources, include_dirs=include_dirs, define_macros=define_macros, extra_compile_args=extra_compile_args, ), extension( "model.utils.cython_bbox", ["model/utils/bbox.pyx"], extra_compile_args={'cxx':[],'gcc': ["-Wno-cpp", "-Wno-unused-function"]}, include_dirs=[numpy_include] ) ]
and now I don't see this issue anymore.
Thanks, it worked for me!
I add this, but a new error occurs:
NameError: name 'numpy_include' is not defined
Thus how to define the numpy_include
?
I add this, but a new error occurs:
NameError: name 'numpy_include' is not defined
Thus how to define the
numpy_include
?
Add this
try: numpy_include = np.get_include() except AttributeError: numpy_include = np.get_numpy_include()
I should run export CUDA_HOME=/usr/local/cuda-11.0 firstly when I ran python setup.py build develop. This would solve my problem when anaconda cudatoolkit version is not consistent with system`s cuda version.