tensorflow / tpu

Reference models and tools for Cloud TPUs.
https://cloud.google.com/tpu/
Apache License 2.0
5.2k stars 1.77k forks source link

KeyError: 'The key `include_mask` does not exist. ' in cascade_maskrcnn_effb7_1280 #969

Closed PallawiSinghal closed 2 years ago

PallawiSinghal commented 2 years ago

Please help me I am trying to train the model cascade_maskrcnn_effb7_1280.yaml. I have created the tfrecords and now trying to run the main.py to trigger the training on my 4 Tesla V100-DGXS GPUS. This is the command I am using to start the training but it fails with the above error:

MODEL_DIR="/tpu/models/official/detection/weights/" TRAIN_FILE_PATTERN="/tpu/tools/datasets/data/vexcel/tfrecords/train/" EVAL_FILE_PATTERN="/tpu/tools/datasets/data/vexcel/tfrecords/validation/" VAL_JSON_FILE="/tpu/tools/datasets/data/vexcel/instances_val2017.json" RESNET_CHECKPOINT="/tpu/models/cascade_maskrcnn_effb7_1280/model.ckpt-180000" python3 /tpu/models/official/detection/main.py \ --model_dir="${MODEL_DIR?}" \ --mode=train \ --eval_after_training=True \ --use_tpu=False \ --config_file="/tpu/models/official/detection/projects/copy_paste/configs/cascade_maskrcnn_effb7_1280.yaml" --include_mask --params_override="{ train: { checkpoint: { path: ${RESNET_CHECKPOINT?}, prefix: resnet50/ }, train_file_pattern: ${TRAIN_FILE_PATTERN?} }, eval: { val_json_file: ${VAL_JSON_FILE?}, eval_file_pattern: ${EVAL_FILE_PATTERN?} } }"

PallawiSinghal commented 2 years ago

Solved this one - if you are missing a key while training a Mask-RCNN model then look into these files and add the respective keys. tpu/models/official/detection/modeling/maskrcnn_model.py you will be able to solve this by referring to this file and adding the keys.