Skip to content

Commit 09eb259

Browse files
authored
fix wav2lip export (#836)
* fix wav2lip export
1 parent 21ee373 commit 09eb259

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tools/export_model.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,12 @@ def main(args, cfg):
7676
model = ppgan.models.builder.build_model(cfg.model)
7777
model.setup_train_mode(is_train=False)
7878
state_dicts = ppgan.utils.filesystem.load(args.load)
79-
for net_name, net in model.nets.items():
80-
if net_name in state_dicts:
81-
net.set_state_dict(state_dicts[net_name])
79+
if 'Wav2Lip' in cfg.model.name:
80+
model.nets['netG'].set_state_dict(state_dicts)
81+
else:
82+
for net_name, net in model.nets.items():
83+
if net_name in state_dicts:
84+
net.set_state_dict(state_dicts[net_name])
8285
model.export_model(cfg.export_model, args.output_dir, inputs_size,
8386
args.export_serving_model, args.model_name)
8487
logger = get_logger(name='ppgan')

0 commit comments

Comments
 (0)