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

compiled successfully but no attribute named get_config_file #15

Open
akshay772 opened this issue Jun 19, 2020 · 2 comments
Open

compiled successfully but no attribute named get_config_file #15

akshay772 opened this issue Jun 19, 2020 · 2 comments

Comments

@akshay772
Copy link

Screenshot from 2020-06-19 13-28-22

@sainatarajan
Copy link

Try this:

cfg = get_cfg()
cfg.DATASETS.TRAIN = ("wheat_train",)
cfg.DATASETS.TEST = ()
cfg.DATALOADER.NUM_WORKERS = 2

cfg.MODEL.META_ARCHITECTURE= 'GeneralizedRCNN'
cfg.MODEL.BACKBONE.NAME= 'build_resnet_fpn_backbone'
cfg.MODEL.RESNETS.OUT_FEATURES= ["res2", "res3", "res4", "res5"]
cfg.MODEL.FPN.IN_FEATURES= ["res2", "res3", "res4", "res5"]
cfg.MODEL.ANCHOR_GENERATOR.SIZES= [[32], [64], [128], [256], [512]]
cfg.MODEL.ANCHOR_GENERATOR.ASPECT_RATIOS= [[0.5, 1.0, 2.0]]
cfg.MODEL.RPN.IN_FEATURES= ["p2", "p3", "p4", "p5", "p6"]
cfg.MODEL.RPN.PRE_NMS_TOPK_TRAIN= 2000
cfg.MODEL.RPN.PRE_NMS_TOPK_TEST= 1000
cfg.MODEL.RPN.POST_NMS_TOPK_TRAIN= 1000
cfg.MODEL.RPN.POST_NMS_TOPK_TEST= 1000
cfg.MODEL.ROI_HEADS.NAME= 'StandardROIHeads'
cfg.MODEL.ROI_HEADS.IN_FEATURES= ["p2", "p3", "p4", "p5"]
cfg.MODEL.ROI_BOX_HEAD.NAME= 'FastRCNNConvFCHead'
cfg.MODEL.ROI_BOX_HEAD.NUM_FC= 2
cfg.MODEL.ROI_BOX_HEAD.POOLER_RESOLUTION= 7
cfg.MODEL.ROI_MASK_HEAD.NAME= 'MaskRCNNConvUpsampleHead'
cfg.MODEL.ROI_MASK_HEAD.NUM_CONV= 4
cfg.MODEL.ROI_MASK_HEAD.POOLER_RESOLUTION= 14
cfg.MODEL.MASK_ON= False
cfg.MODEL.RESNETS.DEPTH= 101
cfg.SOLVER.IMS_PER_BATCH = 2
cfg.SOLVER.BASE_LR = 0.00025
cfg.SOLVER.MAX_ITER = 20000
cfg.SOLVER.STEPS= (60000, 80000)
cfg.INPUT.MIN_SIZE_TRAIN= (640, 672, 704, 736, 768, 800)
cfg.VERSION= 2

cfg.MODEL.ROI_HEADS.BATCH_SIZE_PER_IMAGE = 512
cfg.MODEL.ROI_HEADS.NUM_CLASSES = 1  # only has one class (Wheat)

os.makedirs(cfg.OUTPUT_DIR, exist_ok=True)
trainer = DefaultTrainer(cfg)
trainer.resume_or_load(resume=False)
trainer.train()

@yeeunsong
Copy link

@akshay772 did you solve this problem? having the same problem with you.
When I checked the 'init.py' and 'model_zoo.py' file in detectron2/model_zoo directory,
the code in this repository and the official facebook repository was different.

This repo's init.py:

from .model_zoo import get, ModelZooUrls

Official facebook repo's init.py:

from .model_zoo import get, get_config_file, get_checkpoint_url

__all__ = ["get_checkpoint_url", "get", "get_config_file"]

You can see that there is no get_checkpoint_url and get_config_file function in this repo's implementation

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

3 participants