  from keras import losses as k_losses
  from keras import backend as K
  from keras.layers import Input
  from keras.models import load_model, Model as KModel
  from keras.optimizers import Adam, Nadam, RMSprop
  
  from lib.serializer import get_serializer
  from lib.model.backup_restore import Backup
  from lib.model import losses, optimizers
  from lib.model.nn_blocks import set_config as set_nnblock_config
 
</s> remove from lib.utils import get_backend, FaceswapError
 </s> add from lib.utils import get_backend, get_tf_version, FaceswapError </s> remove from keras.optimizers import Optimizer
 </s> add from keras.optimizers import Optimizer, Adam, Nadam, RMSprop  # noqa pylint:disable=unused-import </s> remove from keras.utils import get_custom_objects

from lib.utils import get_backend
 </s> add  </s> remove from keras.utils import get_custom_objects
 </s> add 
  from keras import losses as k_losses
  from keras import backend as K
  from keras.layers import Input
  from keras.models import load_model, Model as KModel

  
  from lib.serializer import get_serializer
  from lib.model.backup_restore import Backup
  from lib.model import losses, optimizers
  from lib.model.nn_blocks import set_config as set_nnblock_config
keep keep keep keep replace keep keep keep keep keep
 Update code to support Tensorflow versions up to 2.8 (#1213)

* Update maximum tf version in setup + requirements

* - bump max version of tf version in launcher
- standardise tf version check

* update keras get_custom_objects  for tf>2.6

* bugfix: force black text in GUI file dialogs (linux)

* dssim loss - Move to stock tf.ssim function

* Update optimizer imports for compatibility

* fix logging for tf2.8

* Fix GUI graphing for TF2.8

* update tests

* bump requirements.txt versions

* Remove limit on nvidia-ml-py

* Graphing bugfixes
  - Prevent live graph from displaying if data not yet available

* bugfix: Live graph. Collect loss labels correctly

* fix: live graph - swallow inconsistent loss errors

* Bugfix: Prevent live graph from clearing during training

* Fix graphing for AMD 
plugins/train/model/_base.py