Closed ngfuong closed 3 years ago
What command did you use in training and testing?
For training, I created soft link from dataset to /content/ folder, then I used:
os.chdir("/content/")
os.environ['TRAIN'] = "/content/drive/MyDrive/Object-Detection/Swin-Transformer-Object-Detection/tools/train.py"
os.environ['CONFIGS'] = "/content/drive/MyDrive/Object-Detection/Swin-Transformer-Object-Detection/configs/swin/cascade_mask_rcnn_swin_base_patch4_window7_mstrain_480-800_giou_4conv1f_adamw_1x_cityscapes.py"
os.environ['WORK_DIR'] = "/content/drive/MyDrive/Object-Detection/Swin-Transformer-Object-Detection/checkpoints/swin_base_cascade_mask_cityscapes_1x_amp"
os.environ['PRETRAIN'] = "/content/drive/MyDrive/Object-Detection/Swin-Transformer-Object-Detection/checkpoints/swin_base_patch4_window7_224_22k.pth"
!python $TRAIN $CONFIGS --work-dir $WORK_DIR --cfg-options model.pretrained=$PRETRAIN
For testing:
os.chdir("/content/")
os.environ['TEST'] = "/content/drive/MyDrive/Object-Detection/Swin-Transformer-Object-Detection/tools/test.py"
os.environ['CONFIGS'] = "/content/drive/MyDrive/Object-Detection/Swin-Transformer-Object-Detection/configs/swin/cascade_mask_rcnn_swin_base_patch4_window7_mstrain_480-800_giou_4conv1f_adamw_1x_cityscapes.py"
os.environ['CHECKPOINT'] = "/content/drive/MyDrive/Object-Detection/Swin-Transformer-Object-Detection/checkpoints/swin_base_cascade_mask_cityscapes_1x_amp/epoch_12.pth"
!python $TEST $CONFIGS $CHECKPOINT --eval bbox segm
@ZwwWayne hello I've just scrolled through all the issues that might relate to my problem. Is it possible that my problem has the same cause as #2361? If so, how can I resolve/work around this problem? Thank you!
Cityscapes does not have test gt. I changed the test set to val set and it works okay.
I am having the same issue, but with a custom dataset, what do you mean by "test gt?" thank you.
I am having the same issue, but with a custom dataset, what do you mean by "test gt?" thank you.
It's annotations for test ground truth. Cityscapes does not provide annotations for its test set so I had to change it to the validation set. If you use a custom dataset this might not be the case. There are several issues similar to yours that have already been resolved (e.g #4494). You should browse the issues for more information.
I have met the same problem @IoU=0.75. Please don't use "np.arange" in Line 214 of "mmdet/datasets/cityscapes.py: evaluate" which is caused by "np.arange(0.5, 0.96, 0.05)[5]=0.7500000000000002"
I have met the same problem when i use Cityscapes datatset.
I fixed it by replacing np.arange(0.5, 0.96, 0.05) to np.linspace(.5, 0.95, int(np.round((0.95 - .5) / .05)) + 1, endpoint=True) on iou_thrs in Line 214 of "mmdet/datasets/cityscapes.py: evaluate".
I trained Swin Transformers Cityscapes Instance Segmentation from pretrained Swin Base on ImageNet 22K. During training, evaluations are very normal. E.g:
However, after evaluating (test.py) using the
epoch_*.pth
checkpoint file, all the AP and AR are -1. This is the inference output:This is my configs:
Specifically, I changed
SyncBN
toBN
, changed someAutoAugment
policies and changeduse_checkpoints
fromFalse
toTrue
to save GPU memory. There is a warningNone of the inputs have requires_grad=True. Gradients will be None
while inferencing. Does this have anything to do with my output? How can I fix this? Thank you!