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

AttributeError: 'GeneralizedSEEM' object has no attribute 'evaluate_demo' #12

Open
jordanhart opened this issue Nov 29, 2023 · 5 comments

Comments

@jordanhart
Copy link

jordanhart commented Nov 29, 2023

Hi! First, really awesome work. I absolutely love this.

Second, when running the demo demo_som.py with a Seem inference, I noticed 2 errors. First, MPI is not defined in seem/utils/distributed.py. The from mpi4py import MPI statement is missing. Second, I get this error when running the seem model in the demo 'AttributeError: 'GeneralizedSEEM' object has no attribute 'evaluate_demo'. I installed the package by pip install git+https://github.com/UX-Decoder/Segment-Everything-Everywhere-All-At-Once.git@package

Please advise on how to fix. Thank you for all the awesome research.

@jordanhart
Copy link
Author

jordanhart commented Nov 30, 2023

I added a fix for the import statement being missing UX-Decoder/Segment-Everything-Everywhere-All-At-Once#100. I am not sure how to fix the other error, and would love advice. Thank you so much! @jwyang

@MaureenZOU
Copy link
Collaborator

for this 'GeneralizedSEEM' object has no attribute 'evaluate_demo', which line do you report this error? Should try model.model.evaluate_demo()

@jordanhart
Copy link
Author

jordanhart commented Dec 1, 2023

The error occurs on line 62 of SoM/task_adapter/seem/tasks/inference_seem_interactive.py
File "SoM/task_adapter/seem/tasks/inference_seem_interactive.py", line 62, in inference_seem_interactive
masks, _ = model.model.evaluate_demo([data])
File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1695, in getattr
raise AttributeError(f"'{type(self).name}' object has no attribute '{name}'")
AttributeError: 'GeneralizedSEEM' object has no attribute 'evaluate_demo'

This is reproduced by using the install directions for this repo, including installing the package branch of Seem with 'pip install git+https://github.com/UX-Decoder/Segment-Everything-Everywhere-All-At-Once.git@package'. Then fixing distributed.py with adding the line 'from mpi4py import MPI' as shown in this PR UX-Decoder/Segment-Everything-Everywhere-All-At-Once#100.

Then run python demo_som.py, and click the 'Run' button with the interactive segmentation mode with seem and a mask on the image

image @MaureenZOU

@bschleter
Copy link

The error occurs on line 62 of SoM/task_adapter/seem/tasks/inference_seem_interactive.py File "SoM/task_adapter/seem/tasks/inference_seem_interactive.py", line 62, in inference_seem_interactive masks, _ = model.model.evaluate_demo([data]) File "/opt/conda/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1695, in getattr raise AttributeError(f"'{type(self).name}' object has no attribute '{name}'") AttributeError: 'GeneralizedSEEM' object has no attribute 'evaluate_demo'

This is reproduced by using the install directions for this repo, including installing the package branch of Seem with 'pip install git+https://github.com/UX-Decoder/Segment-Everything-Everywhere-All-At-Once.git@package'. Then fixing distributed.py with adding the line 'from mpi4py import MPI' as shown in this PR UX-Decoder/Segment-Everything-Everywhere-All-At-Once#100.

@jordanhart This got it to work for me. Convoluted to do in Google Colab but it works nonetheless. In my clone of the repo it doesn't pull the distributed.py file with the MPI import even though it looked as if they updated it in the repo, but when going through it looks like they haven't made a change since you did the PR.
Regardless, until or if they do the PR thank you for finding the solution. I gave up on this over a month ago because couldn't figure out why it wasn't pulling MPI.

@abrichr
Copy link
Contributor

abrichr commented Feb 6, 2024

In #19 we use https://github.com/UX-Decoder/Segment-Everything-Everywhere-All-At-Once.git@33f2c8, which is the commit behind https://github.com/UX-Decoder/Segment-Everything-Everywhere-All-At-Once/tree/package as of time of writing.

For some reason, the latest commit on that branch removes MPI. Using the previous commit (and installing mpi4py) does the trick.

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

4 participants