Closed FLYDust1101 closed 10 months ago
You've chosen to report an unexpected problem or bug. Unless you already know the root cause of it, please include details about it by filling the issue template. The following information is missing: "Instructions To Reproduce the Issue and Full Logs"; "Your Environment";
Requested information was not provided in 7 days, so we're closing this issue.
Please open new issue if information becomes available. Otherwise, use github discussions for free-form discussions.
When it train, it run the code run_step() -- class TrainBase When it eval, use detectron2.evaluation.inference_on_dataset
OrderedDict([('bbox', {'AP': 0.00024255127390703898, 'AP50': 0.0005441165354860879, 'AP75': nan, 'APs': 0.0, 'APm': 0.0005503269509548185, 'APl': 0.0004439579840761939, 'AP-person': 0.0, 'AP-bicycle': 0.0, 'AP-car': 0.0, 'AP-motorcycle': 0.0, 'AP-airplane': 0.0, 'AP-bus': 0.0, 'AP-train': 0.0, 'AP-truck': 0.0, 'AP-boat': 0.0, 'AP-traffic light': 0.0, 'AP-fire hydrant': 0.0, 'AP-stop sign': 0.0, 'AP-parking meter': 5.207820307022969e-05, 'AP-bench': 0.0, 'AP-bird': 0.0, 'AP-cat': 0.0, 'AP-dog': 0.0, 'AP-horse': 0.0, 'AP-sheep': 0.0, 'AP-cow': 0.0, 'AP-elephant': 0.0, 'AP-bear': 0.0, 'AP-zebra': 0.0, 'AP-giraffe': 0.0, 'AP-backpack': 0.0, 'AP-umbrella': 0.0, 'AP-handbag': 0.0, 'AP-tie': 0.0, 'AP-suitcase': 0.0, 'AP-frisbee': 0.0, 'AP-skis': 0.0, 'AP-snowboard': 0.0, 'AP-sports ball': 0.0, 'AP-kite': 0.0, 'AP-baseball bat': 0.0, 'AP-baseball glove': 0.0, 'AP-skateboard': 0.0, 'AP-surfboard': 0.0, 'AP-tennis racket': 0.0, 'AP-bottle': 0.0, 'AP-wine glass': 0.0, 'AP-cup': 0.0, 'AP-fork': 0.0, 'AP-knife': 0.0, 'AP-spoon': 0.0, 'AP-bowl': 0.0, 'AP-banana': 0.0, 'AP-apple': 0.0, 'AP-sandwich': 0.0, 'AP-orange': 0.0, 'AP-broccoli': 0.0, 'AP-carrot': 0.0, 'AP-hot dog': 0.0, 'AP-pizza': 0.0, 'AP-donut': 0.0, 'AP-cake': 0.0, 'AP-chair': 0.0, 'AP-couch': 0.0, 'AP-potted plant': 0.0, 'AP-bed': 0.019352023709492887, 'AP-dining table': 0.0, 'AP-toilet': 0.0, 'AP-tv': 0.0, 'AP-laptop': 0.0, 'AP-mouse': 0.0, 'AP-remote': 0.0, 'AP-keyboard': 0.0, 'AP-cell phone': 0.0, 'AP-microwave': 0.0, 'AP-oven': 0.0, 'AP-toaster': 0.0, 'AP-sink': 0.0, 'AP-refrigerator': 0.0, 'AP-book': 0.0, 'AP-clock': 0.0, 'AP-vase': 0.0, 'AP-scissors': 0.0, 'AP-teddy bear': 0.0, 'AP-hair drier': 0.0, 'AP-toothbrush': 0.0})])
Process finished with exit code 0
Configs:
CUDNN_BENCHMARK: false DATALOADER: ASPECT_RATIO_GROUPING: true FILTER_EMPTY_ANNOTATIONS: true NUM_WORKERS: 0 REPEAT_THRESHOLD: 0.0 SAMPLER_TRAIN: TrainingSampler DATASETS: CROSS_DATASET: false PRECOMPUTED_PROPOSAL_TOPK_TEST: 1000 PRECOMPUTED_PROPOSAL_TOPK_TRAIN: 2000 PROPOSAL_FILES_TEST: [] PROPOSAL_FILES_TRAIN: [] TEST:
Codes
from trainer import FCOSTrainer import os from modeling.fcos.FCOS import FCOS from detectron2.layers import ShapeSpec
from detectron2.checkpoint import DetectionCheckpointer from detectron2.engine import default_argument_parser, default_setup, launch from detectron2.config import get_cfg from add_model_config import add_fcos_config from detectron2.engine import DefaultTrainer,DefaultPredictor from detectron2.evaluation import DatasetEvaluators,
from detectron2.evaluation import inference_on_dataset from detectron2.data import build_detection_test_loader, MetadataCatalog from detectron2.data.datasets import register_coco_instances
def setup(args): cfg = get_cfg() add_fcos_config(cfg) # 配置文件1 - 原始定义 cfg.merge_from_file(args.config_file) # 配置文件2 - 覆盖 cfg.merge_from_list(args.opts) cfg.MODEL.WEIGHTS = "D:\lyb\demo1\output_0\model_0029999.pth"
cfg.DATASETS.TEST = (dataset_name,)
def main(args): cfg = setup(args) Trainer = DefaultTrainer(cfg)
if name == "main": args = default_argument_parser().parse_args() print("Command Line Args:", args) launch( main, args.num_gpus, num_machines=args.num_machines, machine_rank=args.machine_rank, dist_url=args.dist_url, args=(args,), )