models icon indicating copy to clipboard operation
models copied to clipboard

object_detection: Allow to provide RunConfig parameters on command line of model_main

Open volkerstampa opened this issue 8 years ago • 4 comments

System information

  • What is the top-level directory of the model you are using: object_detection
  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): no
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Ubuntu 16.04.5 LTS (Xenial Xerus)
  • TensorFlow installed from (source or binary): binary
  • TensorFlow version (use command below): ('v1.10.1-0-g4dcfddc5d1', '1.10.1')
  • Bazel version (if compiling from source): -
  • CUDA/cuDNN version: cuda-9.0
  • GPU model and memory: Tesla K80 major: 3 minor: 7 / 11.17GiB
  • Exact command to reproduce: - (This is a feature request)

Describe the problem

An Estimator run is configured with a RunConfig object, however when starting model_main parameters of RunConfig can not be defined to overwrite defaults. That is why I propose to add command line parameters to model_main that allow to define RunConfig parameters. I see two options here:

  1. Add specific command line parameters for specific RunConfig parameters, e.g. --save_checkpoints_steps, --save_checkpoints_secs, ...
  2. Add a generic command line parameter for RunConfig parameters similar to the already existing --hparams_overrides. E.g. --runconfig_overrides save_checkpoints_steps=100,keep_checkpoint_max=10

Option 2 should result in less maintenance when RunConfig is changed. OTOH it would only allow to overwrite primitive parameters, but no structured parameters like session_config. With Option 1 changes in RunConfig might need to be reflected in code. OTOH it would for example allow to define command line switches for session_config parameters.

I would personally vote for Option 2 and if there is interest I could also open a PR for this.

volkerstampa avatar Sep 05 '18 09:09 volkerstampa

@derekjchow -- can you comment on this feature request?

karmel avatar Sep 14 '18 23:09 karmel

when I run below code in comand, it show me some error like the bottom . research]# python object_detection/model_main.py --pipeline_config_path=${PIPELINE_CONFIG_PATH} --model_dir=${MODEL_DIR} --num_train_steps=${NUM_TRAIN_STEPS} --sample_1_of_n_eval_examples=$SAMPLE_1_OF_N_EVAL_EXAMPLES --hparams_overrides="batch_size=16"

Error: information:

raise ValueError('Unknown hyperparameter type for %s' % name)

ValueError: Unknown hyperparameter type for batch_size

My goal is to train the required property values in the config file through the command update model.

lighTQ avatar Jan 21 '19 06:01 lighTQ

Hi There, We are checking to see if you still need help on this, as this seems to be considerably old issue. Please update this issue with the latest information, code snippet to reproduce your issue and error you are seeing. If we don't hear from you in the next 7 days, this issue will be closed automatically. If you don't need help on this issue any more, please consider closing this.

tensorflowbutler avatar Jan 29 '20 19:01 tensorflowbutler

The help that I need would be a comment, if the feature and the PR I provided makes sense to you and if you would be willing to accept the PR. Thanks.

volkerstampa avatar Jan 31 '20 07:01 volkerstampa