Skip to content

Commit

Permalink
Remove load weights from old file
Browse files Browse the repository at this point in the history
  • Loading branch information
dluvizon authored Jul 17, 2020
1 parent 23a8a92 commit fbebb14
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions exp/pennaction/train_penn_multimodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@
full_model = spnet.build(cfg)

"""Load pre-trained weights from pose estimation and copy replica layers."""
full_model.load_weights(
# 'output/mpii_spnet_51_f47147e/weights_mpii_spnet_8b4l_039.hdf5',
'output/penn_multimodel_trial_15_only_mpii_pose_be215a3/weights_mpii+penn_ar_007.hdf5',
by_name=True)
# Here it is recommended to load a model pre-trained (few epochs) on pose estimation!
#full_model.load_weights(
# 'output/mpii_spnet_51_f47147e/weights_mpii_spnet_8b4l_039.hdf5',
# by_name=True)

# from keras.models import Model
# full_model = Model(full_model.input,
Expand Down Expand Up @@ -140,13 +140,13 @@ def end_of_epoch_callback(epoch):
fcallback, models = prepare_training(False, start_lr)
trainer = MultiModelTrainer(models[1:], [ar_data_tr], workers=12,
print_full_losses=True)
# trainer.train(2, steps_per_epoch=steps_per_epoch, initial_epoch=0,
# end_of_epoch_callback=fcallback)
trainer.train(2, steps_per_epoch=steps_per_epoch, initial_epoch=0,
end_of_epoch_callback=fcallback)

"""Joint learning the full model."""
fcallback, models = prepare_training(True, start_lr)
trainer = MultiModelTrainer(models, [pe_data_tr, ar_data_tr], workers=12,
print_full_losses=True)
trainer.train(30, steps_per_epoch=steps_per_epoch, initial_epoch=7,
trainer.train(30, steps_per_epoch=steps_per_epoch, initial_epoch=2,
end_of_epoch_callback=fcallback)

0 comments on commit fbebb14

Please sign in to comment.