ModuleNotFoundError: No module named 'tensorflow.keras.legacy'

2.3k Views Asked by At

Unable to find legacy module, I hope I can ask for help,Siamese Network The code is the Siamese Network for One Shot Learining on Github, but I'm having problems running it.

    from tensorflow.keras.legacy import interfaces
    import tensorflow.keras.backend as K
    from tensorflow.keras.optimizers import Optimizer
    import legacy
    from interface import interface



class Modified_SGD(Optimizer):
  @interface.legacy_get_updates_support
   def get_updates(self, loss, params):
      grads = self.get_gradients(loss, params)
      self.updates = [K.update_add(self.iterations, 1)]

      lr = self.lr
      if self.initial_decay > 0:
         lr *= (1. / (1. + self.decay * K.cast(self.iterations,
                                              K.dtype(self.decay))
0

There are 0 best solutions below