title: Dynamically Editing Pipeline Config for Tensorflow Object Detection
body: <p>I'm using tensorflow object detection API, and I want to be able to edit config file dynamically in python, which looks like this. I thought of using protocol buffers library in python, but I'm not sure how to go about. </p>
  
  <pre><code>model {
  ssd {
  num_classes: 1
  image_resizer {
    fixed_shape_resizer {
      height: 300
      width: 300
    }
  }
  feature_extractor {
    type: "ssd_inception_v2"
    depth_multiplier: 1.0
    min_depth: 16
    conv_hyperparams {
      regularizer {
        l2_regularizer {
          weight: 3.99999989895e-05
        }
      }
      initializer {
        truncated_normal_initializer {
          mean: 0.0
          stddev: 0.0299999993294
        }
      }
      activation: RELU_6
      batch_norm {
        decay: 0.999700009823
        center: true
        scale: true
        epsilon: 0.0010000000475
        train: true
      }
    }
   ...
   ...
  </code></pre>
  
  <p>}</p>
  
  <p>Is there a simple/easy way to change specific values for fields like height in image_resizer -> fixed_shape_resizer from say 300 to 500? And write back the file with modified values without changing anything else?</p>
  
  <p>EDIT:
  Though answer provided by @DmytroPrylipko worked for most of the parameters in the config, I face some issues with "composite field"..</p>
  
  <p>That is, if we have configuration like:</p>
  
  <pre><code>train_input_reader: {
    label_map_path: "/tensorflow/data/label_map.pbtxt"
    tf_record_input_reader {
      input_path: "/tensorflow/models/data/train.record"
    }
  }
  </code></pre>
  
  <p>And I add this line to edit input_path:</p>
  
  <pre><code> pipeline_config.train_input_reader.tf_record_input_reader.input_path = "/tensorflow/models/data/train100.record"
  </code></pre>
  
  <p>It throws error:</p>
  
  <pre><code>TypeError: Can't set composite field
  </code></pre>