aioz-ai / CVPRW21_GPS

Graph-based Person Signature for Person Re-Identifications (CVPRW 21)
https://blog.ai.aioz.io/research/gps-reid/
MIT License
16 stars 8 forks source link

test error #6

Open Ishihara-Masabumi opened 1 year ago

Ishihara-Masabumi commented 1 year ago

When I run the test.py, the following error occurred.

python3 test.py --config_file configs/market1501_gps_softmax_triplet_center.yml MODEL.PRETRAIN_CHOICE "('self')" TEST.WEIGHT "('pretrained/GPS_market1501.pth')"
2022-12-07 16:22:33,956 reid_baseline INFO: Using 1 GPUS
2022-12-07 16:22:33,956 reid_baseline INFO: Namespace(config_file='configs/market1501_gps_softmax_triplet_center.yml', opts=['MODEL.PRETRAIN_CHOICE', "('self')", 'TEST.WEIGHT', "('pretrained/GPS_market1501.pth')"])
2022-12-07 16:22:33,956 reid_baseline INFO: Loaded configuration file configs/market1501_gps_softmax_triplet_center.yml
2022-12-07 16:22:33,956 reid_baseline INFO: 
MODEL:
  PRETRAIN_CHOICE: 'imagenet'
  PRETRAIN_PATH: 'pretrained/resnet50-pretrained/resnet50-19c8e357.pth'
  METRIC_LOSS_TYPE: 'triplet_center'
  IF_LABELSMOOTH: 'on'
  IF_WITH_CENTER: 'yes'

INPUT:
  SIZE_TRAIN: [256, 128]
  SIZE_TEST: [256, 128]
  PROB: 0.25 # random horizontal flip
  RE_PROB: 0.35 # random erasing
  PADDING: 10

DATASETS:
  NAMES: ('market1501')

DATALOADER:
  SAMPLER: 'softmax_triplet'
  NUM_INSTANCE: 4
  NUM_WORKERS: 8

SOLVER:
  OPTIMIZER_NAME: 'Adam'
  MAX_EPOCHS: 120
  BASE_LR: 0.00035

  CLUSTER_MARGIN: 0.3

  CENTER_LR: 0.5
  CENTER_LOSS_WEIGHT: 0.003

  RANGE_K: 2
  RANGE_MARGIN: 0.3
  RANGE_ALPHA: 0
  RANGE_BETA: 1
  RANGE_LOSS_WEIGHT: 1

  BIAS_LR_FACTOR: 1
  WEIGHT_DECAY: 0.0005
  WEIGHT_DECAY_BIAS: 0.0005
  IMS_PER_BATCH: 64

  STEPS: [40, 70]
  GAMMA: 0.1

  WARMUP_FACTOR: 0.01
  WARMUP_ITERS: 10
  WARMUP_METHOD: 'linear'

  CHECKPOINT_PERIOD: 40
  LOG_PERIOD: 20
  EVAL_PERIOD: 40

TEST:
  IMS_PER_BATCH: 128
  RE_RANKING: 'no'
  WEIGHT: "path"
  NECK_FEAT: 'after'
  FEAT_NORM: 'yes'

OUTPUT_DIR: "models/market1501/GPS"

2022-12-07 16:22:33,956 reid_baseline INFO: Running with config:
DATALOADER:
  NUM_INSTANCE: 4
  NUM_WORKERS: 8
  SAMPLER: softmax_triplet
DATASETS:
  NAMES: market1501
  ROOT_DIR: dataset
INPUT:
  PADDING: 10
  PIXEL_MEAN: [0.485, 0.456, 0.406]
  PIXEL_STD: [0.229, 0.224, 0.225]
  PROB: 0.25
  RE_PROB: 0.35
  SIZE_TEST: [256, 128]
  SIZE_TRAIN: [256, 128]
MODEL:
  ATT: on
  BACKBONE: resnet50_nl
  DEVICE: cuda
  DEVICE_ID: 0
  IF_LABELSMOOTH: on
  IF_WITH_CENTER: yes
  LAST_STRIDE: 1
  METRIC_LOSS_TYPE: triplet_center
  NECK: bnneck
  PART: on
  PRETRAIN_CHOICE: self
  PRETRAIN_PATH: pretrained/resnet50-pretrained/resnet50-19c8e357.pth
OUTPUT_DIR: models/market1501/GPS
SOLVER:
  ATT_WEIGHT: 0.5
  BASE_LR: 0.00035
  BIAS_LR_FACTOR: 1
  CENTER_LOSS_WEIGHT: 0.003
  CENTER_LR: 0.5
  CHECKPOINT_PERIOD: 40
  CLUSTER_MARGIN: 0.3
  EVAL_PERIOD: 40
  GAMMA: 0.1
  ID_LOSS_WEIGHT: 1.0
  IMS_PER_BATCH: 64
  LOG_PERIOD: 20
  MARGIN: 0.3
  MAX_EPOCHS: 120
  MOMENTUM: 0.9
  OPTIMIZER_NAME: Adam
  RANGE_ALPHA: 0
  RANGE_BETA: 1
  RANGE_K: 2
  RANGE_LOSS_WEIGHT: 1
  RANGE_MARGIN: 0.3
  STEPS: (40, 70)
  TRIPLET_LOSS_WEIGHT: 1.0
  WARMUP_FACTOR: 0.01
  WARMUP_ITERS: 10
  WARMUP_METHOD: linear
  WEIGHT_DECAY: 0.0005
  WEIGHT_DECAY_BIAS: 0.0005
TEST:
  FEAT_NORM: yes
  IMS_PER_BATCH: 128
  NECK_FEAT: after
  RE_RANKING: no
  WEIGHT: pretrained/GPS_market1501.pth
Traceback (most recent call last):
  File "test.py", line 69, in <module>
    main()
  File "test.py", line 61, in main
    train_loader, val_loader, num_query, num_classes = make_data_loader(cfg)
  File "/home/ishihara/CVPRW21_GPS/data/build.py", line 23, in make_data_loader
    dataset = init_dataset(cfg.DATASETS.NAMES, root=cfg.DATASETS.ROOT_DIR)
  File "/home/ishihara/CVPRW21_GPS/data/datasets/__init__.py", line 23, in init_dataset
    return __factory[name](*args, **kwargs)
  File "/home/ishihara/CVPRW21_GPS/data/datasets/market1501.py", line 51, in __init__
    query = self._process_dir(self.query_dir, relabel=False)
  File "/home/ishihara/CVPRW21_GPS/data/datasets/market1501.py", line 91, in _process_dir
    mask_path = osp.join(self.mask_dir, self.mask_path[img_id])
KeyError: '1488_c5s3_071737_00.jpg'

"1488_c5s3_071737_00.jpg" file isn't in the market1501 folder from the begining. What should I do?

widedh commented 1 year ago

Hello, there is due to the naming of some images. There is an extra '.jpg' at the end.