mmdetection
mmdetection copied to clipboard
AssertionError: The length of palette should not be less than `num_classes`.
Thanks for your error report and we appreciate it a lot.
Checklist
The length of palette should not be less than num_classes
.
我的类别数量是40,然而我打印出palette的长度是20,
我运行的代码是: inferencer = DetInferencer(model=config_file,weights=checkpoint_file,device='cuda:0') result = inferencer(imgpath,out_dir=out_dir,show=False)
错误显示是:
palette: 20
classes 40
Traceback (most recent call last):
File "/home/ai-developer/data/mmdetection-main/inforence_peidian_ceshi.py", line 50, in
AssertionError: The length of palette should not be less than num_classes
.
@meng8407 你可以修改 palette 的长度。或者在推理时候直接指定 --palette random
@meng8407 你可以修改 palette 的长度。或者在推理时候直接指定 --palette random
您好,我想问在mmdetection源码的哪个位置可以修改palette 我在两场景中都会出现这个问题, 1.运行mmdeploy转tensorrt时候 2.运行的代码 inferencer = DetInferencer(model=config_file,weights=checkpoint_file,device='cuda:0') result = inferencer(imgpath,out_dir=out_dir,show=False)
期待您的回答
DetInferencer 在初始化时候是可以传入 palette 参数的,你可以看下
DetInferencer 在初始化时候是可以传入 palette 参数的,你可以看下
好的,谢谢您