SHI-Labs / OneFormer

OneFormer: One Transformer to Rule Universal Image Segmentation, arxiv 2022 / CVPR 2023
https://praeclarumjj3.github.io/oneformer
MIT License
1.51k stars 134 forks source link

Tried to analyze the trained model, no config #65

Closed TayJen closed 1 year ago

TayJen commented 1 year ago

In tools/analyze_model.py file there are imports from oneformer

from oneformer import (
    add_oneformer_config,
    add_common_config,
    add_swin_config,
    add_dinat_config,
    add_beit_adapter_config,
    add_convnext_config,
)

However there is no such config function as add_beit_adapter_config() in oneformer/config.py

Also there are some troubles with using tools/analyze_model.py script, as it tries to import caffe2, but there is no such in installation or requirements.txt. (Here I just commented it. It seems like it would work without caffe2)

Traceback (most recent call last):
  File "tools/analyze_model.py", line 12, in <module>
    from detectron2.utils.analysis import (
  File "/app/work_folder/venv/lib/python3.8/site-packages/detectron2/utils/analysis.py", line 10, in <module>
    from detectron2.export import TracingAdapter
  File "/app/work_folder/venv/lib/python3.8/site-packages/detectron2/export/__init__.py", line 3, in <module>
    from .api import *
  File "/app/work_folder/venv/lib/python3.8/site-packages/detectron2/export/api.py", line 6, in <module>
    from caffe2.proto import caffe2_pb2
ModuleNotFoundError: No module named 'caffe2'
praeclarumjj3 commented 1 year ago

Hi @TayJen, thanks for pointing this out! Could you try running the script after removing add_beit_adapter_config from everywhere? It's from an earlier dummy experiment.

About the caffe2 package, it seems to be required by detectron2, could you try running pip3 install caffe2 if you face any issues with that?

praeclarumjj3 commented 1 year ago

I am closing this issue due to inactivity. Feel free to re-open.