tensorflow / tensorflow/models

[DeepLab] How to use my own tf_initial_checkpoint, specifically the resulting graph from a model trained on deeplab the usual way on another dataset?

Open
#9,714 0 comments 0 reactions 3 assignees View on GitHub

@aquariusjay is already working on this.

Since Feb 8, 2021.

models:research type:support
Dominant language
Python
Stars
77.7k
Forks
44.8k
PR merge metrics
No merged PRs in 30d

Description

In DeepLab v3+, I have managed to my use own dataset and train on it using a tf_initial_checkpoint from pascalvoc pre-trained models provided at the Model Zoo. These were some parameters as set during training.

--initialize_last_layer=False
--last_layers_contain_logits_only=True
--fine_tune_batch_norm=True \

Now I have the resulting model checkpoints and a frozen graph export (.pb) from this training.

I have 6 other datasets which are subsets of this previous dataset, and I now wish to train on them separately (they have different number of classes). For that, I would want to use the initial checkpoint as this previously trained model.

Upon trying to do that (setting tf_initial_checkpoint to .../xyzdir/model.ckpt , where .../xyzdir/ contains copies of model checkpoints and frozen_inference_graph.pb from previous training), deeplab does acknowledge the presence of this checkpoint, but starts training from zero nevertheless. MioUs obtained from using the frozen graph directly on my new dataset are ~0.6, and using this newly trained one will start from absolute zero learning and absymal MioUs.

How to use my checkpoints properly as initial checkpoints for other datasets? Does this even make sense, since only the last layer might be getting re-initialized resulting in training from scratch.

I should mention that the exact names of produced .pb and .ckpt files were different, I tried using them as is, and also tried after renaming them to the generic frozen_inference_graph.pb and model.ckpt.index )

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.