mobilenetv2+ deeplabv3+训练正常,测试时报错
Created by: hp-cuiwb
python3 pdseg/eval.py --use_gpu --cfg ./configs/deeplabv3p_mobilenetv2_wx.yaml {'AUG': {'AUG_METHOD': 'stepscaling', 'FIX_RESIZE_SIZE': (2048, 1024), 'FLIP': False, 'FLIP_RATIO': 0.5, 'INF_RESIZE_VALUE': 500, 'MAX_RESIZE_VALUE': 600, 'MAX_SCALE_FACTOR': 2.0, 'MIN_RESIZE_VALUE': 400, 'MIN_SCALE_FACTOR': 0.5, 'MIRROR': True, 'RICH_CROP': {'ASPECT_RATIO': 0.33, 'BLUR': False, 'BLUR_RATIO': 0.1, 'BRIGHTNESS_JITTER_RATIO': 0.5, 'CONTRAST_JITTER_RATIO': 0.5, 'ENABLE': False, 'MAX_ROTATION': 15, 'MIN_AREA_RATIO': 0.5, 'SATURATION_JITTER_RATIO': 0.5}, 'SCALE_STEP_SIZE': 0.25}, 'BATCH_SIZE': 4, 'DATALOADER': {'BUF_SIZE': 256, 'NUM_WORKERS': 8}, 'DATASET': {'DATA_DIM': 3, 'DATA_DIR': './dataset/wx_seg/', 'IGNORE_INDEX': 255, 'IMAGE_TYPE': 'rgb', 'NUM_CLASSES': 2, 'PADDING_VALUE': [127.5, 127.5, 127.5], 'SEPARATOR': ' ', 'TEST_FILE_LIST': './dataset/wx_seg/test.list', 'TEST_TOTAL_IMAGES': 1169, 'TRAIN_FILE_LIST': './dataset/wx_seg/train.list', 'TRAIN_TOTAL_IMAGES': 1169, 'VAL_FILE_LIST': './dataset/wx_seg/val.list', 'VAL_TOTAL_IMAGES': 1169, 'VIS_FILE_LIST': None}, 'EVAL_CROP_SIZE': (2049, 1025), 'FREEZE': {'MODEL_FILENAME': 'model', 'PARAMS_FILENAME': 'params', 'SAVE_DIR': 'freeze_model'}, 'MEAN': [0.5, 0.5, 0.5], 'MODEL': {'BN_MOMENTUM': 0.99, 'DEEPLAB': {'ASPP_WITH_SEP_CONV': True, 'BACKBONE': 'mobilenetv2', 'DECODER_USE_SEP_CONV': True, 'DEPTH_MULTIPLIER': 1.0, 'ENABLE_DECODER': True, 'ENCODER_WITH_ASPP': True, 'OUTPUT_STRIDE': 16}, 'DEFAULT_EPSILON': 1e-05, 'DEFAULT_GROUP_NUMBER': 32, 'DEFAULT_NORM_TYPE': 'bn', 'FP16': False, 'HRNET': {'STAGE2': {'NUM_CHANNELS': [40, 80], 'NUM_MODULES': 1}, 'STAGE3': {'NUM_CHANNELS': [40, 80, 160], 'NUM_MODULES': 4}, 'STAGE4': {'NUM_CHANNELS': [40, 80, 160, 320], 'NUM_MODULES': 3}}, 'ICNET': {'DEPTH_MULTIPLIER': 0.5, 'LAYERS': 50}, 'MODEL_NAME': 'deeplabv3p', 'MULTI_LOSS_WEIGHT': [1.0], 'PSPNET': {'DEPTH_MULTIPLIER': 1, 'LAYERS': 50}, 'SCALE_LOSS': 'DYNAMIC', 'UNET': {'UPSAMPLE_MODE': 'bilinear'}}, 'NUM_TRAINERS': 1, 'SLIM': {'KNOWLEDGE_DISTILL': False, 'KNOWLEDGE_DISTILL_IS_TEACHER': False, 'KNOWLEDGE_DISTILL_TEACHER_MODEL_DIR': '', 'NAS_ADDRESS': '', 'NAS_IS_SERVER': True, 'NAS_PORT': 23333, 'NAS_SEARCH_STEPS': 100, 'NAS_SPACE_NAME': '', 'NAS_START_EVAL_EPOCH': 0, 'PRUNE_PARAMS': '', 'PRUNE_RATIOS': []}, 'SOLVER': {'BEGIN_EPOCH': 1, 'CROSS_ENTROPY_WEIGHT': None, 'DECAY_EPOCH': [10, 20], 'GAMMA': 0.1, 'LOSS': ['softmax_loss'], 'LR': 0.01, 'LR_POLICY': 'poly', 'LR_WARMUP': False, 'LR_WARMUP_STEPS': 2000, 'MOMENTUM': 0.9, 'MOMENTUM2': 0.999, 'NUM_EPOCHS': 2, 'OPTIMIZER': 'sgd', 'POWER': 0.9, 'WEIGHT_DECAY': 4e-05}, 'STD': [0.5, 0.5, 0.5], 'TEST': {'TEST_MODEL': './saved_model/deeplabv3p_mobilenetv2-1-0_bn_wx_4/final'}, 'TRAIN': {'MODEL_SAVE_DIR': 'saved_model/deeplabv3p_mobilenetv2-1-0_bn_wx_4', 'PRETRAINED_MODEL_DIR': 'pretrained_model/deeplabv3p_mobilenetv2-1-0_bn_coco', 'RESUME_MODEL_DIR': '', 'SNAPSHOT_EPOCH': 1, 'SYNC_BATCH_NORM': True}, 'TRAINER_ID': 0, 'TRAIN_CROP_SIZE': (769, 769)} #Device count: 1 W0306 18:06:40.927876 397 device_context.cc:236] Please NOTE: device: 0, CUDA Capability: 75, Driver API Version: 10.1, Runtime API Version: 10.0 W0306 18:06:40.930438 397 device_context.cc:244] device: 0, cuDNN Version: 7.6. load test model: ./saved_model/deeplabv3p_mobilenetv2-1-0_bn_wx_4/final Traceback (most recent call last): File "pdseg/eval.py", line 187, in main() File "pdseg/eval.py", line 183, in main evaluate(cfg, **args.dict) File "pdseg/eval.py", line 149, in evaluate conf_mat.calculate(pred, grts, masks) File "/home/cwb/code/PaddleSeg/pdseg/metrics.py", line 47, in calculate shape=(self.num_classes, self.num_classes)) File "/home/cwb/anaconda3/lib/python3.7/site-packages/scipy/sparse/compressed.py", line 52, in init other = self.class(coo_matrix(arg1, shape=shape)) File "/home/cwb/anaconda3/lib/python3.7/site-packages/scipy/sparse/coo.py", line 192, in init self._check() File "/home/cwb/anaconda3/lib/python3.7/site-packages/scipy/sparse/coo.py", line 279, in _check raise ValueError('row index exceeds matrix dimensions') ValueError: row index exceeds matrix dimensions