  
      def store_input_shapes(self, model):
          """ Store the input and output shapes to state """
          logger.debug("Adding input shapes to state for model")
          inputs = {tensor.name: tensor.get_shape().as_list()[-3:] for tensor in model.inputs}
          if not any(inp for inp in inputs.keys() if inp.startswith("face")):
              raise ValueError("No input named 'face' was found. Check your input naming. "
                               "Current input names: {}".format(inputs))
          self.state.inputs = inputs
          logger.debug("Added input shapes: %s", self.state.inputs)
 
</s> remove         out = [tensor.get_shape().as_list()[-3:] for tensor in model.outputs]
 </s> add         # PlaidML doesn't support tensor.get_shape()
        if keras.backend.backend() == "plaidml.keras.backend":
            out = [list(tensor.shape.dims)[-3:] for tensor in model.outputs]
        else:
            out = [tensor.get_shape().as_list()[-3:] for tensor in model.outputs] </s> remove         optimizer = Adam(lr=5e-5, beta_1=0.5, beta_2=0.999, clipnorm=1.0)
 </s> add         # PlaidML has a bug regarding the clipnorm parameter
        # See: https://github.com/plaidml/plaidml/issues/228
        # Workaround by simply removing it.
        # TODO: Remove this as soon it is fixed in PlaidML.
        if keras.backend.backend() == "plaidml.keras.backend":
            optimizer = Adam(lr=5e-5, beta_1=0.5, beta_2=0.999)
        else:
            optimizer = Adam(lr=5e-5, beta_1=0.5, beta_2=0.999, clipnorm=1.0)
        # PlaidML doesn't support tensor.get_shape()
        if keras.backend.backend() == "plaidml.keras.backend":
            inputs = {tensor.name: list(tensor.shape.dims)[-3:] for tensor in model.inputs}
        else:
            inputs = {tensor.name: tensor.get_shape().as_list()[-3:] for tensor in model.inputs}
  
      def store_input_shapes(self, model):
          """ Store the input and output shapes to state """
          logger.debug("Adding input shapes to state for model")
        # PlaidML doesn't support tensor.get_shape()
        if keras.backend.backend() == "plaidml.keras.backend":
            inputs = {tensor.name: list(tensor.shape.dims)[-3:] for tensor in model.inputs}
        else:
            inputs = {tensor.name: tensor.get_shape().as_list()[-3:] for tensor in model.inputs}
          if not any(inp for inp in inputs.keys() if inp.startswith("face")):
              raise ValueError("No input named 'face' was found. Check your input naming. "
                               "Current input names: {}".format(inputs))
          self.state.inputs = inputs
          logger.debug("Added input shapes: %s", self.state.inputs)
keep keep keep keep replace keep keep keep keep keep
 Plaidml handling in model/_base (#624) 
plugins/train/model/_base.py