Indeed, gpus is missing from argparse.
The following will fix your error:
-    parser.add_argument("--n_tpu_cores", dest="tpu_cores", type=int, default=0)
+    parser.add_argument("--n_tpu_cores", dest="tpu_cores", type=int)

but then it fails again elsewhere. I’m looking at it now.