title: How to set parameters in keras to be non-trainable?
body: <p>I am new to Keras and I am building a model. I want to freeze the weights of the last few layers of the model while training the previous layers. I tried to set the trainable property of the lateral model to be False, but it dosen't seem to work. Here is the code and the model summary:</p>
  
  <pre><code>opt = optimizers.Adam(1e-3)
  domain_layers = self._build_domain_regressor()
  domain_layers.trainble = False
  feature_extrator = self._build_common()
  img_inputs = Input(shape=(160, 160, 3))
  conv_out = feature_extrator(img_inputs)
  domain_label = domain_layers(conv_out)
  self.domain_regressor = Model(img_inputs, domain_label)
  self.domain_regressor.compile(optimizer = opt, loss='binary_crossentropy', metrics=['accuracy'])
  self.domain_regressor.summary()
  </code></pre>
  
  <p>The model summary: <a href="https://i.stack.imgur.com/nWR8q.png" rel="noreferrer">model summary</a>.</p>
  
  <p>As you can see, <code>model_1</code> is trainable. But according to the code, it is set to be non-trainable.</p>