zhangyp15 / MonoFlex

Released code for Objects are Different: Flexible Monocular 3D Object Detection, CVPR21
MIT License
216 stars 40 forks source link

ImportError: dynamic module does not define module export function (PyInit__ext) #31

Open Light-- opened 3 years ago

Light-- commented 3 years ago

i prepared the environment according to the README, but still reports this error:

Traceback (most recent call last):
  File "/tmp-data/user1/code/3d_object_detection/MonoFlex-main/tools/plain_train_net.py", line 25, in <module>
    from model.detector import KeypointDetector
  File "/tmp-data/user1/code/3d_object_detection/MonoFlex-main/model/detector.py", line 6, in <module>
    from .backbone import build_backbone
  File "/tmp-data/user1/code/3d_object_detection/MonoFlex-main/model/backbone/__init__.py", line 1, in <module>
    from .dla_dcn import build_backbone
  File "/tmp-data/user1/code/3d_object_detection/MonoFlex-main/model/backbone/dla_dcn.py", line 16, in <module>
    from model.backbone.DCNv2.dcn_v2 import DCN
  File "/tmp-data/user1/code/3d_object_detection/MonoFlex-main/model/backbone/DCNv2/dcn_v2.py", line 13, in <module>
    import _ext as _backend
ImportError: dynamic module does not define module export function (PyInit__ext)
Chenzixi1 commented 3 years ago

I meet the same problem. had you solved it?

Lan2Kailee commented 3 years ago

我也遇到了此问题,请问你们解决了吗?谢谢啦?

gledsonmelotti commented 2 years ago

I have the same problem. Could anyone provide a solution?

KDJJJ commented 2 years ago

Could anyone have solved this problem?

jackyyang-cv commented 2 years ago

I have the same problem Could anyone provide a solution?

RookieXwc commented 2 years ago

I solve this problem, in MonoFlex/model/backbone/DCNv2/dcn_v2.py add:

import sys
# print(sys.path)
sys.path.remove('/yourpath/model/backbone/DCNv2')
sys.path.insert(0,'/yourpath/model/backbone/DCNv2')
benz725 commented 1 year ago

I solve this problem, in MonoFlex/model/backbone/DCNv2/dcn_v2.py add:

import sys
# print(sys.path)
sys.path.remove('/yourpath/model/backbone/DCNv2')
sys.path.insert(0,'/yourpath/model/backbone/DCNv2')

I works. When I run this repo on server with GeForce 2080Ti, this code work properly. But when I run this repo on my notebook with 2060, It seems to need add your code listed above. Thank you.