运行Faster-RCNN时出现 ModuleNotFoundError: No module named ‘lib.utils.cython_bbox’
- 一、问题描述
- 二、解决流程
* - 1、修改Faster-RCNN-TensorFlow-Python3\data/coco/PythonAPI/setup.py文件:在第15行加上
- 2、由于没有bbox.c和blob.py文件。所以要先在Faster-RCNN-TensorFlow-Python3\lib\utils执行
- 3、再在./data/coco/PythonAPI下面运行
我跑的源码地址:https://github.com/dBeker/Faster-RCNN-TensorFlow-Python3
一、问题描述
运行Faster-RCNN时出现 ModuleNotFoundError: No module named ‘lib.utils.cython_bbox’
二、解决流程
1、修改Faster-RCNN-TensorFlow-Python3\data/coco/PythonAPI/setup.py文件:在第15行加上
,
Extension( 'lib.utils.cython_bbox',
sources=['../../../lib/utils/bbox.c','../../../lib/utils/bbox.pyx'],
include_dirs = [np.get_include(), '/lib/utils'],
extra_compile_args=[], )
修改后如下:
ext_modules = [
Extension(
'pycocotools._mask',
sources=['../common/maskApi.c', 'pycocotools/_mask.pyx'],
include_dirs = [np.get_include(), '../common'],
extra_compile_args=[],
),
Extension( 'lib.utils.cython_bbox',
sources=['../../../lib/utils/bbox.c','../../../lib/utils/bbox.pyx'],
include_dirs = [np.get_include(), '/lib/utils'],
extra_compile_args=[], )
]
2、由于没有bbox.c和blob.py文件。所以要先在Faster-RCNN-TensorFlow-Python3\lib\utils执行
python setup.py build_ext --inplace
注意:生成cython_bbox.c和cython_bbox.pyx,然后将这两个改名为bbox.c和bbox.pyx。如下图所示:
3、再在./data/coco/PythonAPI下面运行
python setup.py build_ext --inplace
python setup.py build_ext install
再次运行,不再报告错误。有个人测试可用。
[En]
Run again, no longer report an error. A personal test is available.
参考:https://blog.csdn.net/weixin_40437821/article/details/105075571
Original: https://blog.csdn.net/mao_hui_fei/article/details/120588340
Author: 翟羽嚄
Title: 运行Faster-RCNN时出现 ModuleNotFoundError: No module named ‘lib.utils.cython_bbox‘
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/514314/
转载文章受原作者版权保护。转载请注明原作者出处!