GFocalV2 icon indicating copy to clipboard operation
GFocalV2 copied to clipboard

KeyError: 'GFocalHead is not in the head registry'

Open xiaosa96 opened this issue 3 years ago • 7 comments

hellow ,When I tried to run test.py with vscode, an error occurred: KeyError: 'Gfocalhead is not in the head registry', The command bash./tools/dist_test.sh configs/gfocal/gfocal_r50_fpn_ms2x.py work_dirs/gfocal_r50_fpn_ms2x/latest.pth 1 to run the dist_test.sh file doesn't have this problem. So I want to ask how to solve this problem?My Torch version is 1.5.0, TorchVision 0.6.0, MMDetection version 2.7.0, and MMCV version 1.2.4

xiaosa96 avatar Apr 21 '21 06:04 xiaosa96

I met the same problem when running tools/train.py. Waiting... TOrch version1.7.1 cuda 10.0 mmcv version 1.3.8

jackhu-bme avatar Jul 15 '21 10:07 jackhu-bme

Hello, I meet this error as the same. Do you have fix it?

I met the same problem when running tools/train.py. Waiting... TOrch version1.7.1 cuda 10.0 mmcv version 1.3.8

ghost avatar Sep 11 '21 06:09 ghost

Hello, I meet this error as the same. Do you have fix it?

I met the same problem when running tools/train.py. Waiting... TOrch version1.7.1 cuda 10.0 mmcv version 1.3.8

I faced this many days ago and what suprised me is that when I changed my environment and redownload the latest code on another machine for some other reasons, I didn't face this anymore.My env now is mmdet2.6.0,mmcv1.2.6 and torch1.7.0,cuda10.2. I guess mmcv 1.3.0 above maybe too high.I did't have exact proof. And I read the source code, I didn't find anything wrong. You see, in GFocalV2/mmdet/models/dense_heads/init.py, GFocalHead is imported and appended at the end of the list. Meanwhile, in GFocalV2/mmdet/models/dense_heads/gfocalhead.py, it's registered. In line 51 and 52: @HEADS.register_module() class GFocalHead(AnchorHead): And now, it works pretty well with my command. I 'll upload my mmdet code of GFocalv2 if you tell me it's needed. That's all I know.

jackhu-bme avatar Sep 11 '21 08:09 jackhu-bme

Hello, I meet this error as the same. Do you have fix it?

I met the same problem when running tools/train.py. Waiting... TOrch version1.7.1 cuda 10.0 mmcv version 1.3.8

I faced this many days ago and what suprised me is that when I changed my environment and redownload the latest code on another machine for some other reasons, I didn't face this anymore.My env now is mmdet2.6.0,mmcv1.2.6 and torch1.7.0,cuda10.2. I guess mmcv 1.3.0 above maybe too high.I did't have exact proof. And I read the source code, I didn't find anything wrong. You see, in GFocalV2/mmdet/models/dense_heads/init.py, GFocalHead is imported and appended at the end of the list. Meanwhile, in GFocalV2/mmdet/models/dense_heads/gfocalhead.py, it's registered. In line 51 and 52: @HEADS.register_module() class GFocalHead(AnchorHead): And now, it works pretty well with my command. I 'll upload my mmdet code of GFocalv2 if you tell me it's needed. That's all I know.

Thanks! I have change my environment and make the code run! I can fix other errors now! >_<!

ghost avatar Sep 11 '21 12:09 ghost

Hello, I meet this error as the same. Do you have fix it?

I met the same problem when running tools/train.py. Waiting... TOrch version1.7.1 cuda 10.0 mmcv version 1.3.8

I faced this many days ago and what suprised me is that when I changed my environment and redownload the latest code on another machine for some other reasons, I didn't face this anymore.My env now is mmdet2.6.0,mmcv1.2.6 and torch1.7.0,cuda10.2. I guess mmcv 1.3.0 above maybe too high.I did't have exact proof. And I read the source code, I didn't find anything wrong. You see, in GFocalV2/mmdet/models/dense_heads/init.py, GFocalHead is imported and appended at the end of the list. Meanwhile, in GFocalV2/mmdet/models/dense_heads/gfocalhead.py, it's registered. In line 51 and 52: @HEADS.register_module() class GFocalHead(AnchorHead): And now, it works pretty well with my command. I 'll upload my mmdet code of GFocalv2 if you tell me it's needed. That's all I know.

Thanks! I have change my environment and make the code run! I can fix other errors now! >_<!

Can you tell me how to solve it? Thanks

Muke6 avatar Sep 22 '21 05:09 Muke6

Hello, I meet this error as the same. Do you have fix it?

I met the same problem when running tools/train.py. Waiting... TOrch version1.7.1 cuda 10.0 mmcv version 1.3.8

I faced this many days ago and what suprised me is that when I changed my environment and redownload the latest code on another machine for some other reasons, I didn't face this anymore.My env now is mmdet2.6.0,mmcv1.2.6 and torch1.7.0,cuda10.2. I guess mmcv 1.3.0 above maybe too high.I did't have exact proof. And I read the source code, I didn't find anything wrong. You see, in GFocalV2/mmdet/models/dense_heads/init.py, GFocalHead is imported and appended at the end of the list. Meanwhile, in GFocalV2/mmdet/models/dense_heads/gfocalhead.py, it's registered. In line 51 and 52: @HEADS.register_module() class GFocalHead(AnchorHead): And now, it works pretty well with my command. I 'll upload my mmdet code of GFocalv2 if you tell me it's needed. That's all I know.

Thanks! I have change my environment and make the code run! I can fix other errors now! >_<!

Can you tell me how to solve it? Thanks

For me, I simply changed my mmcv version to a low version. Maybe he or she did something different , I don't know.

jackhu-bme avatar Sep 22 '21 06:09 jackhu-bme

这个问题我今天灵机一动想到原因了,这套代码是沿用的mmdetection体系,所以下载下来需要先编译,不能直接跑,编译完了就可以了

PanffeeReal avatar Sep 08 '22 12:09 PanffeeReal