Media-Smart / vedadet

A single stage object detection toolbox based on PyTorch
Apache License 2.0
498 stars 128 forks source link

ImportError: cannot import name 'deform_conv_ext' #32

Closed jodie2235337 closed 3 years ago

jodie2235337 commented 3 years ago

Reproduce TinaFace fellow https://github.com/Media-Smart/vedadet/tree/main/configs/trainval/tinaface/README.md Evaluation(b): python configs/trainval/tinaface/test_widerface.py configs/trainval/tinaface/tinaface.py weight_path Error message was as fellow. Anyone have the same problem ??? Thank you for answering~~~ Traceback (most recent call last): File "test_widerface.py", line 9, in from vedadet.datasets import build_dataloader, build_dataset File "/dfsdata2/jiangjl5_data/vedadet/vedadet/init.py", line 1, in from . import assembler, bridge, criteria, datasets, engines, misc, models, ops File "/dfsdata2/jiangjl5_data/vedadet/vedadet/assembler/init.py", line 1, in from .trainval import trainval File "/dfsdata2/jiangjl5_data/vedadet/vedadet/assembler/trainval.py", line 6, in from vedadet.datasets import build_dataloader, build_dataset File "/dfsdata2/jiangjl5_data/vedadet/vedadet/datasets/init.py", line 2, in from .coco import CocoDataset File "/dfsdata2/jiangjl5_data/vedadet/vedadet/datasets/coco.py", line 14, in from .custom import CustomDataset File "/dfsdata2/jiangjl5_data/vedadet/vedadet/datasets/custom.py", line 9, in from .pipelines import Compose File "/dfsdata2/jiangjl5_data/vedadet/vedadet/datasets/pipelines/init.py", line 8, in from .transforms import (Albu, Expand, MinIoURandomCrop, Normalize, Pad, File "/dfsdata2/jiangjl5_data/vedadet/vedadet/datasets/pipelines/transforms.py", line 9, in from vedadet.misc.bbox import bbox_overlaps File "/dfsdata2/jiangjl5_data/vedadet/vedadet/misc/bbox/init.py", line 1, in from .assigners import MaxIoUAssigner File "/dfsdata2/jiangjl5_data/vedadet/vedadet/misc/bbox/assigners/init.py", line 1, in from .approx_max_iou_assigner import ApproxMaxIoUAssigner File "/dfsdata2/jiangjl5_data/vedadet/vedadet/misc/bbox/assigners/approx_max_iou_assigner.py", line 6, in from ..iou_calculators import build_iou_calculator File "/dfsdata2/jiangjl5_data/vedadet/vedadet/misc/bbox/iou_calculators/init.py", line 2, in from .iou2d_calculator import BboxOverlaps2D File "/dfsdata2/jiangjl5_data/vedadet/vedadet/misc/bbox/iou_calculators/iou2d_calculator.py", line 4, in from ..bbox import bbox_overlaps File "/dfsdata2/jiangjl5_data/vedadet/vedadet/misc/bbox/bbox.py", line 6, in from vedadet.ops import batched_nms File "/dfsdata2/jiangjl5_data/vedadet/vedadet/ops/init.py", line 1, in from .dcn import (DeformConv, DeformConvPack, DeformRoIPooling, File "/dfsdata2/jiangjl5_data/vedadet/vedadet/ops/dcn/init.py", line 1, in from .deform_conv import (DeformConv, DeformConvPack, ModulatedDeformConv, File "/dfsdata2/jiangjl5_data/vedadet/vedadet/ops/dcn/deform_conv.py", line 11, in from . import deform_conv_ext ImportError: cannot import name 'deform_conv_ext'

ZHUANGHP commented 3 years ago

encounting the same error...

Traceback (most recent call last): File "", line 991, in _find_and_load File "", line 961, in _find_and_load_unlocked File "", line 219, in _call_with_frames_removed File "/home/zhuang/Documents/vedadet/vedadet/init.py", line 1, in from . import assembler, bridge, criteria, datasets, engines, misc, models, ops File "/home/zhuang/Documents/vedadet/vedadet/assembler/init.py", line 1, in from .trainval import trainval File "/home/zhuang/Documents/vedadet/vedadet/assembler/trainval.py", line 6, in from vedadet.datasets import build_dataloader, build_dataset File "/home/zhuang/Documents/vedadet/vedadet/datasets/init.py", line 2, in from .coco import CocoDataset File "/home/zhuang/Documents/vedadet/vedadet/datasets/coco.py", line 14, in from .custom import CustomDataset File "/home/zhuang/Documents/vedadet/vedadet/datasets/custom.py", line 9, in from .pipelines import Compose File "/home/zhuang/Documents/vedadet/vedadet/datasets/pipelines/init.py", line 8, in from .transforms import (Albu, Expand, MinIoURandomCrop, Normalize, Pad, File "/home/zhuang/Documents/vedadet/vedadet/datasets/pipelines/transforms.py", line 9, in from vedadet.misc.bbox import bbox_overlaps File "/home/zhuang/Documents/vedadet/vedadet/misc/bbox/init.py", line 1, in from .assigners import MaxIoUAssigner File "/home/zhuang/Documents/vedadet/vedadet/misc/bbox/assigners/init.py", line 1, in from .approx_max_iou_assigner import ApproxMaxIoUAssigner File "/home/zhuang/Documents/vedadet/vedadet/misc/bbox/assigners/approx_max_iou_assigner.py", line 6, in from ..iou_calculators import build_iou_calculator File "/home/zhuang/Documents/vedadet/vedadet/misc/bbox/iou_calculators/init.py", line 2, in from .iou2d_calculator import BboxOverlaps2D File "/home/zhuang/Documents/vedadet/vedadet/misc/bbox/iou_calculators/iou2d_calculator.py", line 4, in from ..bbox import bbox_overlaps File "/home/zhuang/Documents/vedadet/vedadet/misc/bbox/bbox.py", line 6, in from vedadet.ops import batched_nms File "/home/zhuang/Documents/vedadet/vedadet/ops/init.py", line 1, in from .dcn import (DeformConv, DeformConvPack, DeformRoIPooling, File "/home/zhuang/Documents/vedadet/vedadet/ops/dcn/init.py", line 1, in from .deform_conv import (DeformConv, DeformConvPack, ModulatedDeformConv, File "/home/zhuang/Documents/vedadet/vedadet/ops/dcn/deform_conv.py", line 11, in from . import deform_conv_ext ImportError: cannot import name 'deform_conv_ext' from partially initialized module 'vedadet.ops.dcn' (most likely due to a circular import) (/home/zhuang/Documents/vedadet/vedadet/ops/dcn/init.py)

jodie2235337 commented 3 years ago

@ZHUANGHP this bug may casued by low pytorch or cuda version. PyTorch 1.6.0 or higher CUDA 10.2 or higher

Check issue #8 for solution I'm working on it, and update later

ZHUANGHP commented 3 years ago

@jodie2235337 I have tried with a cuda version of 10.2 and PyTorch 1.7.1, same error.

mileistone commented 3 years ago

@jodie2235337 I have tried with a cuda version of 10.2 and PyTorch 1.7.1, same error.

have you compiled it?

ZHUANGHP commented 3 years ago

@jodie2235337 I have tried with a cuda version of 10.2 and PyTorch 1.7.1, same error.

have you compiled it?

Compile cuda? Does PyTorch or cuda need compiling? Thought only C++ programs require this. I have tried several machines for different cuda version (cuda10.1, 10.2) and different PyTorch version (1.6, 1.7). Some error.

jodie2235337 commented 3 years ago

@ZHUANGHP problem solving by: cd vedadet pip install -v -e . reference: https://blog.csdn.net/qq_35975447/article/details/110430390 (Chinese version, hope you don't mind)

chenzhengnan commented 3 years ago

@ZHUANGHP problem solving by: cd vedadet pip install -v -e . reference: https://blog.csdn.net/qq_35975447/article/details/110430390 (Chinese version, hope you don't mind) 答主你好,我执行了 pip install -v -e .之后,还是有同样的问题,请问是不是还有什么别的操作。

ZHUANGHP commented 3 years ago

@ZHUANGHP problem solving by: cd vedadet pip install -v -e . reference: https://blog.csdn.net/qq_35975447/article/details/110430390 (Chinese version, hope you don't mind)

Thanks!

cserezwan commented 2 years ago

Hello, I followed this link: https://blog.csdn.net/qq_35975447/article/details/110430390 but still the same error. Any solution? I'm using CUDA 10.1, do I need to try with 10.2?