google-compute-enginegoogle-cloud-tputpu

TPU RetinaNet - TypeError


I create my dataset and converted to COCO. RetinaNet already installed in TPU (official). I want to use this RetinaNet to train a model with my own dataset but always getting same error.

export MODEL_DIR=${STORAGE_BUCKET}/retinanet-train-eval; \
export RESNET_CHECKPOINT=gs://cloud-tpu-artifacts/resnet/resnet-nhwc-2018-10-14/model.ckpt-112602; \
export TRAIN_FILE_PATTERN=${STORAGE_BUCKET}/coco/coco_train*; \
export EVAL_FILE_PATTERN=${STORAGE_BUCKET}/coco/coco_val*; \
export VAL_JSON_FILE=${STORAGE_BUCKET}/coco/instances_val.json; \
export EVAL_SAMPLES=613 \
export NUM_STEPS_PER_EVAL=868

python /usr/share/tpu/models/official/detection/main.py \
--use_tpu=True \
--tpu="${TPU_NAME?}" \
--num_cores=8 \
--model_dir="${MODEL_DIR?}" \
--mode="train_and_eval" \
--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 ?
    },
    eval_samples: $ {
      EVAL_SAMPLES ?
    },
    num_steps_per_eval: $ {
      NUM_STEPS_PER_EVAL ?
    }
  }
}"

With these settings I getting this error...

type error


Solution

  • The issue should be resolved with the latest Tensorflow 2.x Retinanet model, please try out and comment if you still get errors: https://cloud.google.com/tpu/docs/tutorials/retinanet-2.x