Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named '_ext' #1

Open
AndrewGuo0930 opened this issue Feb 26, 2022 · 3 comments
Open

ModuleNotFoundError: No module named '_ext' #1

AndrewGuo0930 opened this issue Feb 26, 2022 · 3 comments

Comments

@AndrewGuo0930
Copy link

After I ran the command python train.py --model_name DSFNet --gpus 0,1 --lr 1.25e-4 --lr_step 30,45 --num_epochs 55 --batch_size 4 --val_intervals 5 --test_large_size True --datasetname rsdata --data_dir ./data/RsCarData/, it said that ModuleNotFoundError: No module named '_ext'. Here is my error log.

Traceback (most recent call last):
  File "train.py", line 13, in <module>
    from lib.models.stNet import get_det_net,load_model, save_model
  File "/cluster/home/it_stu12/main/SatVideoDT/Moving-object-detection-DSFNet-main/lib/models/stNet.py", line 7, in <module>
    from lib.models.DSFNet_with_Static import DSFNet_with_Static
  File "/cluster/home/it_stu12/main/SatVideoDT/Moving-object-detection-DSFNet-main/lib/models/DSFNet_with_Static.py", line 16, in <module>
    from lib.models.DCNv2.dcn_v2 import DCN
  File "/cluster/home/it_stu12/main/SatVideoDT/Moving-object-detection-DSFNet-main/lib/models/DCNv2/dcn_v2.py", line 13, in <module>
    import _ext as _backend
ModuleNotFoundError: No module named '_ext'

Additionally, here is my environment information.

Python 3.7.0 | packaged by conda-forge | (default, Nov 12 2018, 20:15:55) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.version
'3.7.0 | packaged by conda-forge | (default, Nov 12 2018, 20:15:55) \n[GCC 7.3.0]'
>>> import torch
>>> torch.__version__
'1.7.1'
>>> import torchvision
>>> torchvision.__version__
'0.8.2'
@ChaoXiao12
Copy link
Owner

It seems that you did not compile the DCN. You can refer to the INSTALL of CenterNet to build the conda environment step by step.

@AndrewGuo0930
Copy link
Author

Thank you so much. Is the DCNv2 used in this code compiled with PyTorch 1.7.1?

@WesLee88524
Copy link

Thank you so much. Is the DCNv2 used in this code compiled with PyTorch 1.7.1?

Maybe u can solve this problem by this way : https://github.com/lbin/DCNv2.
It works for me !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants