lolipopshock / Detectron2_AL

Active Learning for Object Detection using Detectron2
44 stars 11 forks source link

Detectron2 ImportError #3

Open julian-voss opened 3 years ago

julian-voss commented 3 years ago

Thank you very much for this great project.

After following along the usage instructions I ran into a Detectron2 ImportError error when trying to initialize the model backend server:

\~\Desktop\repos\Detectron2_AL>label-studio-ml init labeling/backend_model --script\annotating/backend_model.py --force
Traceback (most recent call last):
  File "\AppData\Local\Continuum\anaconda3\envs\labelenv\Scripts\label-studio-ml-script.py", line 33, in <module>
    sys.exit(load_entry_point('label-studio', 'console_scripts', 'label-studio-ml')())
  File "\desktop\repos\detectron2_al\src\label-studio\label_studio\ml\server.py", line 103, in main
    create_dir(args)
  File "\desktop\repos\detectron2_al\src\label-studio\label_studio\ml\server.py", line 64, in create_dir
    model_classes = get_all_classes_inherited_LabelStudioMLBase(script_path)
  File "\desktop\repos\detectron2_al\src\label-studio\label_studio\ml\utils.py", line 15, in get_all_classes_inherited_LabelStudioMLBase
    module = importlib.import_module(module_name)
  File "\AppData\Local\Continuum\anaconda3\envs\labelenv\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "~\Desktop\repos\Detectron2_AL\annotating\backend_model.py", line 24, in <module>
    from detectron2_al.engine.al_engine import ActiveLearningPredictor
  File "./src\detectron2_al\engine\__init__.py", line 1, in <module>
    from .al_engine import *
  File "./src\detectron2_al\engine\al_engine.py", line 13, in <module>
    from detectron2.evaluation import verify_results
  File "\desktop\repos\detectron2-0.1.1\detectron2\evaluation\__init__.py", line 2, in <module>
    from .cityscapes_evaluation import CityscapesEvaluator
  File "\desktop\repos\detectron2-0.1.1\detectron2\evaluation\cityscapes_evaluation.py", line 10, in <module>
    from detectron2.data import MetadataCatalog
  File "\desktop\repos\detectron2-0.1.1\detectron2\data\__init__.py", line 4, in <module>
    from .build import (
  File "\desktop\repos\detectron2-0.1.1\detectron2\data\build.py", line 14, in <module>
    from detectron2.structures import BoxMode
  File "\desktop\repos\detectron2-0.1.1\detectron2\structures\__init__.py", line 2, in <module>
    from .boxes import Boxes, BoxMode, pairwise_iou
  File "\desktop\repos\detectron2-0.1.1\detectron2\structures\boxes.py", line 8, in <module>
    from detectron2.layers import cat
  File "\desktop\repos\detectron2-0.1.1\detectron2\layers\__init__.py", line 3, in <module>
    from .deform_conv import DeformConv, ModulatedDeformConv
  File "\desktop\repos\detectron2-0.1.1\detectron2\layers\deform_conv.py", line 10, in <module>
    from detectron2 import _C
ImportError: DLL load failed while importing _C: The specified module could not be found

I'm using Windows 10. In order to install detectron2 I have download the files from this source and made the required changes proposed by this tutorial before installing the library.

Do you have an idea on what could cause this issue? Any help would be much appreciated.