ZwwWayne/K-Net

KeyError: 'KNet is not in the models registry' when runing 'train.py'

Closed this issue · 2 comments

Description

I directly use your repo as my workspace, the directory tree is shown below(mmdetection has been installed by conda):
image
Then I run the following command which is pretty well when using builtin model:

sh ./tools/mim_slurm_test.sh $PARTITION mmdet $CONFIG $CHECKPOINT --eval segm

Problem

It shows KNet doesn't register:

KeyError: 'KNet is not in the models registry'

Attempt

Repo mim-example mentions that we can simply use the config and the build function. However, the following sample code is no used in the repo, which confused me a lot.

module_cfg = dict(type='mmcv.SwinTransformer')
module = build_backbone(module_cfg)

How can I fix this problem? Any help will be appreciated.

Which version of mmdetection are you using? Do you have trouble in training the model?
The config works for me.
KNet is not in the models registry usually means the file implementing K-Net is not correctly imported, which has no relation with the build function.

Which version of mmdetection are you using? Do you have trouble in training the model? The config works for me. KNet is not in the models registry usually means the file implementing K-Net is not correctly imported, which has no relation with the build function.
Thanks for your sincere reply. I've successfully trained KNet after correcting my config error(KNet been imported on other mm toolbox rather than mmdet).