-
Notifications
You must be signed in to change notification settings - Fork 8
"Can't find 'MetaOneStageDetector' in D2Go's META_ARCH_REGISTRY #15
Comments
As the error message says, please use from d2go.registry.builtin import META_ARCH_REGISTRY instead of detectron2.modeling import META_ARCH_REGISTRY. |
Thanks for the reply, I'm trying to test this project on google colab notebook. When installing requirements from
Any ideas how to resolve that? |
I suggest that you could install AdelaiDet with sound code of it. |
Thanks, managed to partially run it but now
Does this have to do with the fact that can't find |
I met the same problem!The code has some bugs you should fix it as follow:
# the bug is caused at "detectron2/utils/file_io.py"!In the file,the class Detectron2Handler(PathHandler) have not implement the function named "_exists(self,path,**kwargs)" extended from super PathHandler Class!
class Detectron2Handler(PathHandler):
"""
Resolve anything that's hosted under detectron2's namespace.
"""
PREFIX = "detectron2://"
S3_DETECTRON2_PREFIX = "https://dl.fbaipublicfiles.com/detectron2/"
# add the function "_exists(self,path,**kwargs)" ,its affect is to judge the path of file whethe exist!
def _exists(self, path, **kwargs):
print("the path of weight file is :"+path)
return True
def _get_supported_prefixes(self):
return [self.PREFIX]
def _get_local_path(self, path, **kwargs):
name = path[len(self.PREFIX) :]
return PathManager.get_local_path(self.S3_DETECTRON2_PREFIX + name, **kwargs)
def _open(self, path, mode="r", **kwargs):
return PathManager.open(
self.S3_DETECTRON2_PREFIX + path[len(self.PREFIX) :], mode, **kwargs
)
My english is so poor,if you have not understand,you could replay email again!
(Can you speak Chinese? I think we would communicate with each other conveniently!)
From: kirk86 ***@***.***>
Date: 2023-05-16 22:29:27
To: facebookresearch/sylph-few-shot-detection ***@***.***>
Cc: RockJim2001 ***@***.***>,Comment ***@***.***>
Subject: Re: [facebookresearch/sylph-few-shot-detection] "Can't find 'MetaOneStageDetector' in D2Go's META_ARCH_REGISTRY (Issue #15)
Thanks, managed to partially run it but now sylph raises new errors:
ZERO_GRAD_BEFORE_FORWARD: False
INFO:setup:Full config saved to output/meta-fcos/coco/pretrain/config.yaml
INFO:setup:Initializing runner ...
INFO:setup:Running with runner: <sylph.runner.meta_fcos_runner.MetaFCOSRunner object at 0x7ff15c6bbc70>
INFO:setup:Full config saved to output/meta-fcos/coco/pretrain/diff_config.yaml
INFO:__main__:setup_after_launch done
init Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1)) in <generator object Module.modules at 0x7ff150474e40>
init Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1)) in <generator object Module.modules at 0x7ff150474eb0>
init Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1)) in <generator object Module.modules at 0x7ff150474e40>
init Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1)) in <generator object Module.modules at 0x7ff150474eb0>
init Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1)) in <generator object Module.modules at 0x7ff150474e40>
init Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1)) in <generator object Module.modules at 0x7ff150474eb0>
init Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1)) in <generator object Module.modules at 0x7ff150474e40>
init Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1)) in <generator object Module.modules at 0x7ff150474eb0>
init Conv2d(256, 60, kernel_size=(1, 1), stride=(1, 1)) in <generator object Module.modules at 0x7ff150474e40>
init Conv2d(256, 4, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1)) in <generator object Module.modules at 0x7ff150474dd0>
init Conv2d(256, 1, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1)) in <generator object Module.modules at 0x7ff150474eb0>
init Conv2d(256, 1, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1)) in <generator object Module.modules at 0x7ff150474dd0>
weight path: detectron2://ImageNetPretrained/MSRA/R-50.pkl
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/mobile_cv/common/misc/py.py", line 136, in new_func
return func(*args, **kwargs)
File "/content/sylph-few-shot-detection/tools/train_net.py", line 48, in main
model = runner.build_model(cfg)
File "/usr/local/lib/python3.10/dist-packages/d2go/runner/default_runner.py", line 318, in build_model
model = self._build_model(cfg, eval_only)
File "/usr/local/lib/python3.10/dist-packages/d2go/runner/default_runner.py", line 277, in _build_model
model = build_d2go_model(cfg).model
File "/usr/local/lib/python3.10/dist-packages/d2go/modeling/api.py", line 57, in build_d2go_model
model = build_meta_arch(cfg)
File "/usr/local/lib/python3.10/dist-packages/d2go/modeling/api.py", line 47, in build_meta_arch
model = META_ARCH_REGISTRY.get(meta_arch)(cfg)
File "/usr/local/lib/python3.10/dist-packages/detectron2/config/config.py", line 189, in wrapped
explicit_args = _get_args_from_config(from_config_func, *args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/detectron2/config/config.py", line 245, in _get_args_from_config
ret = from_config_func(*args, **kwargs)
File "/content/sylph-few-shot-detection/sylph/modeling/meta_arch/meta_one_stage_detector.py", line 77, in from_config
proposal_generator = build_proposal_generator(
File "/usr/local/lib/python3.10/dist-packages/detectron2/modeling/proposal_generator/build.py", line 24, in build_proposal_generator
return PROPOSAL_GENERATOR_REGISTRY.get(name)(cfg, input_shape)
File "/content/sylph-few-shot-detection/sylph/modeling/meta_fcos/fcos.py", line 178, in __init__
self.fcos_head = MetaFCOSHead(
File "/content/sylph-few-shot-detection/sylph/modeling/meta_fcos/fcos.py", line 292, in __init__
super().__init__(cfg, input_shape)
File "/content/sylph-few-shot-detection/sylph/modeling/meta_fcos/fcos.py", line 131, in __init__
self._init_base_detector_config()
File "/content/sylph-few-shot-detection/sylph/modeling/meta_fcos/fcos.py", line 476, in _init_base_detector_config
self.base_weight, self.base_bias = load_pretrained_class_conv_kernel_weights(
File "/content/sylph-few-shot-detection/sylph/modeling/meta_fcos/fcos.py", line 39, in load_pretrained_class_conv_kernel_weights
if not PathManager.exists(weight_path):
File "/usr/local/lib/python3.10/dist-packages/iopath/common/file_io.py", line 1247, in exists
bret = handler._exists(path, **kwargs) # type: ignore
File "/usr/local/lib/python3.10/dist-packages/iopath/common/file_io.py", line 428, in _exists
raise NotImplementedError()
NotImplementedError
Does this have to do with the fact that can't find weight path: detectron2://ImageNetPretrained/MSRA/R-50.pkl?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
Thanks that seemed to work for a while but now throws a different error, by the way your english is fine and can understand you very well 😉
|
How should we register
MetaOneStageDetector
in D2Go's META_ARCH_REGISTRY? If I'm not mistaken that should be already registered, right?The text was updated successfully, but these errors were encountered: