utils_7.py 329 B

123456
  1. def quick_save(self, model, save_name, optimizer=None):
  2. save_path = os.path.join(self.save_dir, save_name + '_weights.pth')
  3. if optimizer:
  4. opt_weights = optimizer.get_weights()
  5. np.save(os.path.join(self.save_dir, save_name + '_opt_weights'), opt_weights)
  6. model.save_weights(save_path, save_format='h5')