jbwang1997 / OBBDetection

OBBDetection is an oriented object detection library, which is based on MMdetection.
Apache License 2.0
522 stars 112 forks source link

can not import module: from . import corner_pool_ext #75

Open WindFantasy98 opened 2 years ago

WindFantasy98 commented 2 years ago

can not import module: from . import corner_pool_ext The detailed error information is:

importError: libcudart.so.10.1: cannot open shared object file: No such file or directory

how to fix it? thanks!

jbwang1997 commented 2 years ago

The CUDA version of compilation and PyTorch may be mismatch. Please check the version of CUDA.

Jack-zz-ze commented 2 years ago

i also have this problem, how to solve it? OBBDetection-master/mmdet/ops/corner_pool/corner_pool_ext.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZNSt15__exception_ptr13exception_ptr9_M_addrefEv

Jack-zz-ze commented 2 years ago

/my_code/OBBDetection-master$ python demo/huge_image_demo.py demo/dota_demo.png configs/obb/oriented_rcnn/faster_rcnn_orpn_r50_fpn_1x_dota10.py ckpt/faster_rcnn_orpn_r50_fpn_1x_dota10_epoch12.pth BboxToolkit/tools/split_configs/dota1_0/ss_test.json Traceback (most recent call last): File "demo/huge_image_demo.py", line 3, in from mmdet.apis import init_detector, show_result_pyplot File "/home/my_code/OBBDetection-master/mmdet/apis/init.py", line 1, in from .inference import (async_inference_detector, inference_detector, File "/home/my_code/OBBDetection-master/mmdet/apis/inference.py", line 9, in from mmdet.core import get_classes File "/home/my_code/OBBDetection-master/mmdet/core/init.py", line 2, in from .bbox import * # noqa: F401, F403 File "/home/my_code/OBBDetection-master/mmdet/core/bbox/init.py", line 1, in from .assigners import (AssignResult, BaseAssigner, CenterRegionAssigner, File "/home/my_code/OBBDetection-master/mmdet/core/bbox/assigners/init.py", line 1, in from .approx_max_iou_assigner import ApproxMaxIoUAssigner File "/home/my_code/OBBDetection-master/mmdet/core/bbox/assigners/approx_max_iou_assigner.py", line 4, in from ..iou_calculators import build_iou_calculator File "/home/my_code/OBBDetection-master/mmdet/core/bbox/iou_calculators/init.py", line 4, in from .obb.obbiou_calculator import OBBOverlaps, PolyOverlaps File "/home/my_code/OBBDetection-master/mmdet/core/bbox/iou_calculators/obb/obbiou_calculator.py", line 4, in from mmdet.ops import obb_overlaps File "/home/my_code/OBBDetection-master/mmdet/ops/init.py", line 2, in from .corner_pool import CornerPool File "/home/my_code/OBBDetection-master/mmdet/ops/corner_pool/init.py", line 1, in from .corner_pool import CornerPool File "/home/my_code/OBBDetection-master/mmdet/ops/corner_pool/corner_pool.py", line 4, in from . import corner_pool_ext ImportError: /home/my_code/OBBDetection-master/mmdet/ops/corner_pool/corner_pool_ext.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZNSt15__exception_ptr13exception_ptr9_M_addrefEv

wulele2 commented 2 years ago

我也遇到了相同问题,应该是OBBDet中CUDA算子没有编译好。解决方法:在/mmdet/ops/utils/src/的compiling_info.cpp的头文件cuda_runtime-api.h包含其完整路径。比如#include </usr/local/cuda-11.1/include/cuda_runtime_api.h>

huoyiyang commented 2 years ago

我也遇到这个问题了,换了torch1.5和1.8,cuda也都对应的上,但还是报错。您用这个方法解决问题了吗

wulele2 commented 2 years ago

我也遇到这个问题了,换了torch1.5和1.8,cuda也都对应的上,但还是报错。您用这个方法解决问题了吗

我就按照readme装的,最后安装OBBDET时候(python setup.py -v -e .)出现了error: no cuda_runtime_api.h,缺少CUDA的头文件,我服务器CUDA不在本账户下,所以将其改成绝对路径链接CUDA,最后编译通过了。

wulele2 commented 2 years ago

我也遇到这个问题了,换了torch1.5和1.8,cuda也都对应的上,但还是报错。您用这个方法解决问题了吗

我就按照readme装的,最后安装OBBDET时候(python setup.py -v -e .)出现了error: no cuda_runtime_api.h,缺少CUDA的头文件,我服务器CUDA不在本账户下,所以将其改成绝对路径链接CUDA,最后编译通过了。

huoyiyang commented 2 years ago

哦哦,感谢您的回复。我问题是出现在训练时,中午我把mmcv指定版本去掉了,同时用python setup.py install ,似乎可以了,不过我想用ssdd++旋转数据集,现在是coco格式的,请问需要改什么地方呢,config里OBB下的文件中还是用dataset_type = 'DOTADataset'吗

wulele2 commented 2 years ago

我也刚用,最简单方式就是将SSDD++转成DIOR数据集格式,也就是voc格式数据集。然后直接在config的retinanet配置文件下调用下就行。 base = [ '../base/datasets/dior.py', '../base/schedules/schedule_3x.py', '../../base/default_runtime.py' ] 我试了 可以运行。 转DOTA比较麻烦,因为涉及图像裁剪;转HRSC格式我没找到脚本,您找到了欢迎交流。

huoyiyang commented 2 years ago

[您好,我制作好VOC格式的ssdd+数据集了,但是我没太理解您说的在config中的retinanet下调用。比如我想用gliding_vertex来训练ssdd,但是这个gliding_vertex_r50_fpn_1x_dota10.py中已经指定了这些内容:

dataset_type = 'DOTADataset' data_root = 'data/split_ss_dota1_0/'

data_root = 'data/coco/' #modified by hyy

img_norm_cfg = dict( mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True) train_pipeline = [ dict(type='LoadImageFromFile'), dict(type='LoadOBBAnnotations', with_bbox=True, with_label=True, with_poly_as_mask=True), dict(type='LoadDOTASpecialInfo'), dict(type='Resize', img_scale=(1024, 1024), keep_ratio=True), dict(type='OBBRandomFlip', h_flip_ratio=0.5, v_flip_ratio=0.5), dict(type='Normalize', **img_norm_cfg), dict(type='RandomOBBRotate', rotate_after_flip=True, angles=(0, 0), vert_rate=0.5, vert_cls=['roundabout', 'storage-tank']), dict(type='Pad', size_divisor=32), dict(type='DOTASpecialIgnore', ignore_size=2), dict(type='FliterEmpty'), dict(type='Mask2OBB', obb_type='poly'), dict(type='OBBDefaultFormatBundle'), dict(type='OBBCollect', keys=['img', 'gt_bboxes', 'gt_obboxes', 'gt_labels'])

而且它这两个文件一个是dota,一个是HRSC,没有符合我们voc格式的 image 您是怎么修改的呢,可以分享一下吗,感谢

jbwang1997 commented 2 years ago

@huoyiyang 现阶段OBBDetection支持的DIOR-R数据集是旋转框格式的xml标注,可以将数据转化为DIOR-R格式的标注,DIOR-R的配置可以参考这里

SSDD++数据集将在之后支持。

可以新开一个issue讨论这个问题。