Search code examples
pythontensorflowobject-detection-api

Tensorflow 2 Object Detection API - Official Models: What is VAL_JSON_FILE?


To use any of the Object Detection models from TensorFlow's Official Models in the ModelZoo, there is a variable called "VAL_JSON_FILE", which is used for the params_override argument. For my use case, I am performing transfer learning on RetinaNet. The command and arguments are found below:

TPU_NAME="<your GCP TPU name>"
MODEL_DIR="<path to the directory to store model files>"
RESNET_CHECKPOINT="<path to the pre-trained Resnet-50 checkpoint>"
TRAIN_FILE_PATTERN="<path to the TFRecord training data>"
EVAL_FILE_PATTERN="<path to the TFRecord validation data>"
VAL_JSON_FILE="<path to the validation annotation JSON file>"
python3 ~/models/official/vision/detection/main.py \
  --strategy_type=tpu \
  --tpu="${TPU_NAME?}" \
  --model_dir="${MODEL_DIR?}" \
  --mode=train \
  --params_override="{ type: retinanet, 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?} } }"

This is the link: https://github.com/tensorflow/models/blob/master/official/vision/detection/README.md

What is VAL_JSON_FILE used for? Is it necessary? How can I find/create the file?

Thanks!


Solution

  • https://gregsdennis.github.io/Manatee.Json/usage/schema/validation.html
    This link is somewhat relevant and can provide you with more info on JSON validation. It seems to me like it's a testing (validation) of the JSON objects; checking whether it matches types.

    Have you tried to run the learning without that file? I'm not certain but it could be an optional file, or there is a default one already without necessary changes needed.