models icon indicating copy to clipboard operation
models copied to clipboard

[object_detection]What is the parameter `checkpoint_dir` mean in model_main.py ?

Open dapsjj opened this issue 6 years ago • 4 comments

System information What is the top-level directory of the model you are using: models-master/research/object_detection/ Have I written custom code (as opposed to using a stock example script provided in TensorFlow): Yes OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Windows10 TensorFlow installed from (source or binary): binary TensorFlow version (use command below): 1.12.0 Bazel version (if compiling from source): No CUDA/cuDNN version: No GPU model and memory: No GPU/16G memory Exact command to reproduce: No

Problem description:python model_main.py --pipeline_config_path=training/ssd_mobilenet_v1_coco.config --model_dir=training/ --num_train_steps=10000 --alsologtostderr

Problem description:

I want to train my model use models-master/research/object_detection/model_main.py

But I can't understand the parameter model_dir mean.

When I first trained the model, I used this command:

python model_main.py --pipeline_config_path=training/ssd_mobilenet_v1_coco.config --model_dir=training/ --num_train_steps=10000 --alsologtostderr

And after 6000 steps, I stopped training the model.

When I want to continue training, how to set checkpoint_dir?

I use this command:

python model_main.py --pipeline_config_path=training/ssd_mobilenet_v1_coco.config -- model_dir=training/ --checkpoint_dir=training/ --num_train_steps=10000 --alsologtostderr

When I added --checkpoint_dir=training/, the model didn't continue training. Why?How to use --checkpoint_dir?

dapsjj avatar Dec 20 '19 06:12 dapsjj

Thank you for your post. We noticed you have not filled out the following field in the issue template. Could you update them if they are relevant in your case, or leave them as N/A? Thanks. What is the top-level directory of the model you are using Have I written custom code OS Platform and Distribution TensorFlow installed from TensorFlow version Bazel version CUDA/cuDNN version GPU model and memory Exact command to reproduce

tensorflowbutler avatar Dec 21 '19 00:12 tensorflowbutler

Thank you for your post. We noticed you have not filled out the following field in the issue template. Could you update them if they are relevant in your case, or leave them as N/A? Thanks. What is the top-level directory of the model you are using Have I written custom code OS Platform and Distribution TensorFlow installed from TensorFlow version Bazel version CUDA/cuDNN version GPU model and memory Exact command to reproduce

Hi,I learn object detection on windows 10.

I use anaconda(python3.6),tensorflow 1.12.0.I installed tensorflow from http://www.lfd.uci.edu/~gohlke/pythonlibs/

The model_main.py I used is in folder models-master/research/object_detection.

I don't use CUDA/cuDNN.

I don't use GPU and the memory of my computer has 16G.

When I first trained the model, I used this command:

python model_main.py --pipeline_config_path=training/ssd_mobilenet_v1_coco.config --model_dir=training/ --num_train_steps=10000 --alsologtostderr

And after 6000 steps, I stopped training the model.

When I want to continue training, I use this command:

python model_main.py --pipeline_config_path=training/ssd_mobilenet_v1_coco.config -- model_dir=training/ --checkpoint_dir=training/ --num_train_steps=10000 --alsologtostderr

When I added --checkpoint_dir=training/, the model didn't continue training. Why?How to use --checkpoint_dir?

The fie in my training folder looks like this: |--training | |--checkpoint | |--graph.pbtxt | |--model.ckpt-5530.data-00000-of-00001 | |--model.ckpt-5530.index | |--model.ckpt-5530.meta | |--ssd_mobilenet_v1_coco.config

dapsjj avatar Dec 21 '19 00:12 dapsjj

@dapsjj From model_main.py you can see:

flags.DEFINE_string(
    'checkpoint_dir', None, 'Path to directory holding a checkpoint.  If '
    '`checkpoint_dir` is provided, this binary operates in eval-only mode, '
    'writing resulting metrics to `model_dir`.')

Thus, the model will only evaluate, writing metrics to model_dir. Leave out the checkpoint_dir flag if you want it to train.

kaisubr avatar Jan 18 '20 21:01 kaisubr

@kaisubr Thanks!

dapsjj avatar Jan 18 '20 23:01 dapsjj