lxtGH / lxtGH/Panoptic-PartFormer

Demo visualization error

Open
#5 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
63
Forks
3
PR merge metrics
No merged PRs in 30d

Description

Hello,

I am trying to run the demo visualization on a test image:

python3 demo/image_demo.py ../test_image.png configs/pascal_panoptic_part/ppp_r50_fam.py ../checkpoints/ppp_model_r50_e12.pth ./out.png --datasetspec_path panoptic_parts/specs/dataset_specs/ppp_datasetspec.yaml --evalspec_path panoptic_parts/specs/eval_specs/ppq_ppp_59_57_cvpr21_default_evalspec.yaml

but I get the error below. I was wondering if there was an error with the installation of mmdetection or if it something else?

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/mmengine/utils/misc.py", line 77, in import_modules_from_strings
    imported_tmp = import_module(imp)
  File "/usr/lib/python3.8/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 961, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  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 848, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/data/panoptic_partformer/Panoptic-PartFormer/models/__init__.py", line 1, in <module>
    from .assigner import *
  File "/data/panoptic_partformer/Panoptic-PartFormer/models/assigner/__init__.py", line 1, in <module>
    from .mask_hungarian_assigner import DiceCost, MaskCost, MaskHungarianAssigner
  File "/data/panoptic_partformer/Panoptic-PartFormer/models/assigner/mask_hungarian_assigner.py", line 4, in <module>
    from mmdet.core import AssignResult, BaseAssigner, reduce_mean
ModuleNotFoundError: No module named 'mmdet.core'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/mmengine/config/config.py", line 181, in fromfile
    import_modules_from_strings(**cfg_dict['custom_imports'])
  File "/usr/local/lib/python3.8/dist-packages/mmengine/utils/misc.py", line 84, in import_modules_from_strings
    raise ImportError(f'Failed to import {imp}')
ImportError: Failed to import models.panoptic_part

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "demo/image_demo.py", line 62, in <module>
    main(args)
  File "demo/image_demo.py", line 34, in main
    model = init_detector(args.config, args.checkpoint, device=args.device)
  File "/usr/local/lib/python3.8/dist-packages/mmdet/apis/inference.py", line 51, in init_detector
    config = Config.fromfile(config)
  File "/usr/local/lib/python3.8/dist-packages/mmengine/config/config.py", line 183, in fromfile
    raise ImportError('Failed to custom import!') from e
ImportError: Failed to custom import!

When I enter import mmdet, I do not get an error.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with demo/image_demo.py and the configuration import shown in the traceback. Inspect models/assigner/mask_hungarian_assigner.py, especially its mmdet.core import, and compare that dependency with the installed MMDetection and MMEngine versions. Done means the supplied demo command can load the configuration and run without the reported import errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-vision, machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.