detectron2-ResNeSt
detectron2-ResNeSt copied to clipboard
KeyError: 'Non-existent config key: MODEL.RESNETS.RADIX'Please read & provide the following
i wanna use the "train_ResNeSt.py"with "ResNeSt" to train my own datasets,but it show this KeyError.
it print:
(pytorch1.4.0) root@111:~/detectron2-ResNeSt/maize_img/800600# python train_ResNeSt.py
Traceback (most recent call last):
File "train_ResNeSt.py", line 17, in
my train_ResNeSt.py : import random from detectron2.utils.visualizer import Visualizer from detectron2.data.catalog import MetadataCatalog, DatasetCatalog import maize_img import cv2 from detectron2.engine import DefaultTrainer from detectron2.config import get_cfg from detectron2.utils.logger import setup_logger import os setup_logger()
if name == "main": cfg = get_cfg()
**cfg.merge_from_file("/root/detectron2-ResNeSt/configs/COCO-InstanceSegmentation/mask_rcnn_ResNeSt_50_FPN_syncBN_1x.yaml")**
cfg.DATASETS.TRAIN = ("maize_img",)
cfg.DATASETS.TEST = () # no metrics implemented for this dataset
cfg.DATALOADER.NUM_WORKERS = 2
**cfg.MODEL.WEIGHTS = '/root/detectron2/pretrain_model/COCO_InstanceSegmentation_Baselines_with_MaskR-CNN/R50-FPN-3x/model_final_f10217.pkl'**
cfg.SOLVER.IMS_PER_BATCH = 2
cfg.SOLVER.BASE_LR = 0.0025
cfg.SOLVER.MAX_ITER = (2000)
cfg.MODEL.ROI_HEADS.BATCH_SIZE_PER_IMAGE = (128) # faster, and good enough for this toy dataset
cfg.MODEL.ROI_HEADS.NUM_CLASSES = 3 # 3 classes (data, fig, hazelnut)
os.makedirs(cfg.OUTPUT_DIR, exist_ok=True)
trainer = DefaultTrainer(cfg)
trainer.resume_or_load(resume=False)
trainer.train()
how can i solve this problem ?please help me
when i choose cfg.merge_from_file("/root/detectron2-ResNeSt/configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml")
cfg.MODEL.WEIGHTS = '/root/detectron2/pretrain_model/COCO_InstanceSegmentation_Baselines_with_MaskR-CNN/R50-FPN-3x/model_final_f10217.pkl'
it's all right ,it can train normally and i can get my own "model_final.pth",but when i use any "ResNeSt", it has some wrong
@zhanghang1989 @chongruo
please refer to #25
when i choose cfg.merge_from_file("/root/detectron2-ResNeSt/configs/COCO-InstanceSegmentation/mask_rcnn_R_50_FPN_3x.yaml")
cfg.MODEL.WEIGHTS = '/root/detectron2/pretrain_model/COCO_InstanceSegmentation_Baselines_with_MaskR-CNN/R50-FPN-3x/model_final_f10217.pkl'
it's all right ,it can train normally and i can get my own "model_final.pth",but when i use any "ResNeSt", it has some wrong
I think this is due to the Python path issue, just make sure you are running ./tools/train_net.py under the project root folder detectron2-ResNeSt/
Same error here, any update on this?
Please install our detectron fork https://github.com/zhanghang1989/detectron2-ResNeSt/blob/resnest/INSTALL.md
Hi @zhanghang1989 , I have followed the installation guide but I get the same error.
Hi @zhanghang1989 , I have followed the installation guide but I get the same error.
HI,i am so sorry to reply you so late,in 【detectron2-ResNeSt/INSTALL.md】,it's 【# Or, to install it from a local clone: git clone https://github.com/zhanghang1989/detectron2-ResNeSt.git cd detectron2 && python -m pip install -e .】, it should be 【# Or, to install it from a local clone: git clone https://github.com/zhanghang1989/detectron2-ResNeSt.git cd detectron2-ResNeSt && python -m pip install -e .】
Hi @zhanghang1989 , I have followed the installation guide but I get the same error.
HI,i am so sorry to reply you so late,in 【detectron2-ResNeSt/INSTALL.md】,it's 【# Or, to install it from a local clone: git clone https://github.com/zhanghang1989/detectron2-ResNeSt.git cd detectron2 && python -m pip install -e .】, it should be 【# Or, to install it from a local clone: git clone https://github.com/zhanghang1989/detectron2-ResNeSt.git cd detectron2-ResNeSt && python -m pip install -e .】
@zhanghang1989 @chongruo Hi sir , this may be a mistake, please verify it. in 【detectron2-ResNeSt/INSTALL.md】
it should be 【# Or, to install it from a local clone: git clone https://github.com/zhanghang1989/detectron2-ResNeSt.git cd detectron2-ResNeSt && python -m pip install -e .】
@shida666 have you overcome with that issue?? i got the same issue
@shida666 have you overcome with that issue?? i got the same issue
you can try "git clone https://github.com/zhanghang1989/detectron2-ResNeSt.git cd detectron2-ResNeSt && python -m pip install -e ." not "git clone https://github.com/zhanghang1989/detectron2-ResNeSt.git cd detectron2 && python -m pip install -e ."