  import time
  
  from json import JSONDecodeError
  
  from keras import losses
  from keras.models import load_model
  from keras.optimizers import Adam
  from keras.utils import get_custom_objects, multi_gpu_model
  
 
</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) </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         inputs = {tensor.name: tensor.get_shape().as_list()[-3:] for tensor in model.inputs}
 </s> add         # 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}
import keras
  import time
  
  from json import JSONDecodeError
  
import keras
  from keras import losses
  from keras.models import load_model
  from keras.optimizers import Adam
  from keras.utils import get_custom_objects, multi_gpu_model
  
keep keep keep add keep keep keep keep keep
 Plaidml handling in model/_base (#624) 
plugins/train/model/_base.py