open-mmlab / mmdetection

OpenMMLab Detection Toolbox and Benchmark
https://mmdetection.readthedocs.io
Apache License 2.0
29.23k stars 9.4k forks source link

AssertionError: The length of palette should not be less than `num_classes`. #10302

Open anwaar0 opened 1 year ago

anwaar0 commented 1 year ago

I want to display bounding boxes with test.py but facing this issue "The length of the palette should not be less than num_classes."

Below are the details of the dataset and installation environment.

My command line: CUDA_VISIBLE_DEVICES=0 python tools/test.py configs/yolact/yolact_r50_1xb8-55e_coco.py work_dirs/yolact_r50_1xb8-55e_coco/epoch_55.pth --show-dir work_dirs

I have setup mmdetection with this guide https://mmdetection.readthedocs.io/en/latest/get_started.html I think I have the latest version of mmdetection with mmengine, we can see the installation

pip install -U openmim mim install mmengine mim install "mmcv>=2.0.0"

I am using a dataset with 121 classes, I followed the guidelines given at #8003 , however, I did not find any functional code to replace PALETTE = None.

I also have an old version of mmdetection on another PC and the guide at #8003 helped me successfully to replace PALETTE = None.

Now I have a bigger GPU and I installed a newer version of mmdetection, image

Is there any possibility to solve this problem.

Thank you

Sencc commented 1 year ago

You need to expand the list of colors

meng8407 commented 8 months ago

您需要扩展颜色列表 修改哪个位置可以扩展颜色列表