Legacy

class plugins.train.model._base.update.Legacy(model_path: str)

Bases: object

Handles the updating of Keras 2.x models to Keras 3.x

Generally Keras 2.x models will open in Keras 3.x. There are a couple of bugs in Keras 3 legacy loading code which impacts Faceswap models: - When a model receives a shared functional model as an inbound node, the node index needs reducing by 1 (non-trivial to fix upstream) - Keras 3 does not accept nested outputs, so Keras 2 FS models need to have the outputs flattened

Parameters:

model_path (str) – Full path to the legacy Keras 2.x model h5 file to upgrade