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 'detectron2' #4

Open
Rivoks opened this issue May 21, 2024 · 0 comments
Open

ModuleNotFoundError: No module named 'detectron2' #4

Rivoks opened this issue May 21, 2024 · 0 comments

Comments

@Rivoks
Copy link

Rivoks commented May 21, 2024

Hello,

I am trying to install the CO-Det implementation with Autodistill. I had installed autodistill with the given command-line in the the documentation:

pip install autodistill autodistill-grounded-sam autodistill-yolov8

I am running the following demo script:

from autodistill_codet import CoDet
from autodistill.detection import CaptionOntology
from autodistill.utils import plot
import cv2

base_model = CoDet(ontology=CaptionOntology({"person": "person"}))

image_path = "../my-img.jpg"
predictions = base_model.predict(image_path)
image = cv2.imread(image_path)

plot(image=image, detections=predictions, classes=base_model.class_names)

I am getting the following error:

Traceback (most recent call last):
  File "/home/xx/Desktop/auto-labeling-models-evaluation/codet/preview.py", line 1, in <module>
    from autodistill_codet import CoDet
  File "/home/xx/miniconda3/envs/autodistill/lib/python3.11/site-packages/autodistill_codet/__init__.py", line 1, in <module>
    from autodistill_codet.codet_model import CoDet
  File "/home/xx/miniconda3/envs/autodistill/lib/python3.11/site-packages/autodistill_codet/codet_model.py", line 86, in <module>
    import detectron2.utils.comm as comm
ModuleNotFoundError: No module named 'detectron2'

I already tried to install detectron2 separately but the CO-Det install overwrite it anyaway.

Thank you for your help,
Rivoks

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

1 participant