There is a Mask-RCNN implementation in TF Model Garden as well 8. You can try that if you do not manage to resolve your issues with the code base you have been using.
I have a sample for Model Garden’s RetinaNet training + saving here 4. It’s not Mask-RCNN but also a detection model so maybe the code can be useful to you to get through the Model Garden learning curve (the links below open in Colab and TPU training in Colab works in approx. 40 min):
The main training + saving happens in 04ab_retinanet_arthropods_train.ipynb 3. You can reload the model to test it with https://04ac_retinanet_arthropods_predict.ipynb 1 and the last notebook contains the data conversion pipeline, which you can adapt for your own dataset: 04aa_retinanet_arthropods_dataprep.ipynb 1