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

No module named "Detectron2" Bug Fix #1

Merged
merged 4 commits into from
Jun 14, 2023

Conversation

artyaltanzaya
Copy link
Contributor

Changes made

In setup.py added CustomInstall class AutodistillDetic for installing dependencies when building. Some minor typo error. Install_detic() function is not removed or modified in the detic_model.py

Tests

Ran in google colab with pip install . and in conda environment in Mac with pip install . and compared the result with pip3 install autodistill-detic in different conda environment.

pip3 install autodistill-detic returns error such as "no module named supervision, autodistill, or detectron2"

With new modified setup.py using pip install . , the errors are fixed.

Please test for further potential errors.

@artyaltanzaya artyaltanzaya marked this pull request as draft June 8, 2023 23:02
@capjamesg capjamesg self-requested a review June 9, 2023 20:12
@capjamesg capjamesg assigned capjamesg and artyaltanzaya and unassigned capjamesg Jun 9, 2023
@capjamesg capjamesg added the bug Something isn't working label Jun 9, 2023
@capjamesg capjamesg marked this pull request as ready for review June 9, 2023 20:12
Copy link
Member

@capjamesg capjamesg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an elegant implementation! Can you remove the installation commands and associated installation functions and calls from the https://github.com/autodistill/autodistill-detic/blob/main/autodistill_detic/detic_model.py file?

@artyaltanzaya
Copy link
Contributor Author

removed installation commands!

@artyaltanzaya
Copy link
Contributor Author

UPDATE: now install works but using the package returns further errors! Will take a look at it and fix it!

`---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[4], line 1
----> 1 base_model = DETIC(ontology=CaptionOntology({"airplane": "airplane"}))

     20 def setup_cfg(args):
---> 21     from centernet.config import add_centernet_config
     22     from detic.config import add_detic_config
     23     cfg = get_cfg()

ModuleNotFoundError: No module named 'centernet'`

@capjamesg
Copy link
Member

@artyaltanzaya Can you share the code you are running?

@artyaltanzaya
Copy link
Contributor Author

To reproduce the bug try running

base_model = DETIC( ontology=CaptionOntology( { "person": "person", } ) ) after installation

FYI, I fixed it on the new commit and now able to run the model!

@capjamesg capjamesg merged commit 095bba7 into autodistill:main Jun 14, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants