Open zacklew opened 1 month 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";
Instructions To Reproduce the Issue:
Trying to train a model using panoptic_fpn
torch.cuda.empty_cache() config_file = "COCO-PanopticSegmentation/panoptic_fpn_R_50_3x.yaml" cfg = get_cfg() cfg.MODEL.DEVICE = "cuda" if torch.cuda.is_available() else "cpu" cfg.merge_from_file(model_zoo.get_config_file(config_file)) cfg.DATASETS.TRAIN = (f"{data_name}_separated",) cfg.DATASETS.TEST = () cfg.DATALOADER.NUM_WORKERS = 0 cfg.MODEL.WEIGHTS = model_zoo.get_checkpoint_url(config_file)
cfg.SOLVER.IMS_PER_BATCH = 1 cfg.SOLVER.BASE_LR = 0.00025 cfg.SOLVER.MAX_ITER = 5000 cfg.MODEL.ROI_HEADS.BATCH_SIZE_PER_IMAGE = 16 cfg.MODEL.ROI_HEADS.NUM_CLASSES = 1 cfg.MODEL.SEM_SEG_HEAD.NUM_CLASSES = 2 cfg.MODEL.PANOPTIC_FPN.NUM_CLASSES = 1
cfg.SOLVER.AMP.ENABLED = True
MetadataCatalog.get(cfg.DATASETS.TRAIN[0]).set(thing_classes=things, stuff_classes=stuff, thing_dataset_id_to_contiguous_id={1: 0})
Example images that are causing error bad_imgs_2.zip
Expected behavior:
I've run this exact code with a different custom image set and the model ran fine. There are a few images in this image set (i.e. example images and masks below attached) that we have found to through this size error that says the masks and images are different sizes. I manually checked the dimensions of the masks and images using img properties on my PC, and it says the images and masks are the same dimensions. However, when I check the image and mask sizes after the model loads the dataset, the sizes are different. My running theory is that there is some transformation that occurs with the dataset mapper that changes the dimensions of the masks, but I'm not sure how to see if that is the case or if something else in the code is changing the dimensions of the mask and the image separately.
Any and all help trying to solve this error would be appreciated.
*Example images used in dataset in this repo: ([(https://github.com/zacklew/bad_images)])
Environment:
PyTorch built with: