KyanChen / RSPrompter

This is the pytorch implement of our paper "RSPrompter: Learning to Prompt for Remote Sensing Instance Segmentation based on Visual Foundation Model"
https://kychen.me/RSPrompter
Apache License 2.0
505 stars 35 forks source link

ImportError: Failed to import custom modules from {'imports': ['mmdet.rsprompter'], 'allow_failed_imports': False}, the current sys.path is: #77

Closed Yisng closed 2 months ago

Yisng commented 9 months ago

Thanks for your error report and we appreciate it a lot.

Describe the bug ImportError: Failed to import custom modules from {'imports': ['mmdet.rsprompter'], 'allow_failed_imports': False}, the current sys.path is:...

You should set PYTHONPATH to make sys.path include the directory which contains your custom module

Reproduction

  1. What command or script did you run?
python tools/train.py configs/rsprompter/xxx.py  
KyanChen commented 9 months ago

please check all the required pip packages have been installed! See the error before the ImportError!

Auroralyxa commented 9 months ago

please check all the required pip packages have been installed! See the error before the ImportError!

Traceback (most recent call last): File "/home/x/anaconda3/envs/rsprompter/lib/python3.8/site-packages/mmengine/utils/misc.py", line 77, in import_modules_from_strings imported_tmp = import_module(imp) File "/usr/lib/python3.8/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1014, in _gcd_import File "", line 991, in _find_and_load File "", line 973, in _find_and_load_unlocked ModuleNotFoundError: No module named 'mmdet.rsprompter'

Hello,It's failing when I run python tools/train.py configs/rsprompter/rsprompter_anchor-whu.py,How do I solve this problem? Looking forward to your reply

qsd-github commented 8 months ago

I have also encountered this problem. You need to look at each error one by one. Mine is an error in the mmcv library because the version of the mmcv library needs to correspond to the version of the Python library. MMCV version issue resolution link: https://blog.csdn.net/qq_39735236/article/details/128306258

funny000 commented 6 months ago

I have also the problem, my python env have two mmdet, so uninstall one mmdet use "pip uninstall mmdet",It's work.

991215 commented 6 months ago

请检查所有必需的 pip 包是否已安装!请参阅 ImportError!

回溯(最近一次调用最后一次): 文件 “/home/x/anaconda3/envs/rsprompter/lib/python3.8/site-packages/mmengine/utils/misc.py” 第 77 行,在 import_modules_from_strings imported_tmp = import_module(imp) 文件 “/usr/lib/python3.8/importlib/init.py”,第 127 行,在 import_module 中返回 _bootstrap._gcd_import(name[level:], package, level) 文件 “”,第 1014 行,在 _gcd_import 文件 “”, 第 991 行,在 _find_and_load 文件中 “”,第 973 行,在 _find_and_load_unlocked ModuleNotFoundError:没有名为“mmdet.rsprompter”的模块

您好,运行python tools/train.py configs/rsprompter/rsprompter_anchor-whu.py失败,该如何解决这个问题?期待您的回复

Have you solved this problem? If so, what is the reason.

KyanChen commented 2 months ago

请查看更前面的报错或者按项目文档进行配置