Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'GFocalHead is not in the head registry' #16

Open
xiaosa96 opened this issue Apr 21, 2021 · 7 comments
Open

KeyError: 'GFocalHead is not in the head registry' #16

xiaosa96 opened this issue Apr 21, 2021 · 7 comments

Comments

@xiaosa96
Copy link

xiaosa96 commented Apr 21, 2021

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

@jackhu-bme
Copy link

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

@ghost
Copy link

ghost commented Sep 11, 2021

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

@jackhu-bme
Copy link

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.

@ghost
Copy link

ghost commented Sep 11, 2021

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! >_<!

@Muke6
Copy link

Muke6 commented Sep 22, 2021

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

@jackhu-bme
Copy link

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.

@PanffeeReal
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants