Skip to content

Commit 32f9a7e

Browse files
committed
Fixbug update model
1 parent 32d5c0e commit 32f9a7e

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

keras_wrapper/saving.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -233,15 +233,15 @@ def updateModel(model, model_path, update_num, reload_epoch=True, full_path=Fals
233233
logger.info("<<< Updating model " + model_name + " from " + model_path + " ... >>>")
234234

235235
try:
236-
logger.info("<<< Updating model from " + model_path + ".h5 ... >>>")
237-
model.model.set_weights(load_model(model_path + '.h5', compile=False).get_weights())
236+
logger.info("<<< Updating model from " + model_name + ".h5 ... >>>")
237+
model.model.set_weights(load_model(model_name + '.h5', compile=False).get_weights())
238238

239239
except Exception as e:
240240
logger.info(str(e))
241241
# Load model structure
242-
logger.info("<<< Failed -> Loading model from " + model_path + "_weights.h5' ... >>>")
242+
logger.info("<<< Failed -> Loading model from " + model_name + "_weights.h5' ... >>>")
243243
# Load model weights
244-
model.model.load_weights(model_path + '_weights.h5')
244+
model.model.load_weights(model_name + '_weights.h5')
245245

246246
# Load auxiliary models for optimized search
247247
if os.path.exists(model_name + '_init.h5') and os.path.exists(model_name + '_next.h5'):
@@ -254,17 +254,17 @@ def updateModel(model, model_path, update_num, reload_epoch=True, full_path=Fals
254254
if loading_optimized != 0:
255255
logger.info("<<< Updating optimized model... >>>")
256256
if loading_optimized == 1:
257-
logger.info("\t <<< Updating model_init from " + model_path + "_init.h5 ... >>>")
258-
model.model_init.set_weights(load_model(model_path + '_init.h5', compile=False).get_weights())
259-
logger.info("\t <<< Updating model_next from " + model_path + "_next.h5 ... >>>")
260-
model.model_next.set_weights(load_model(model_path + '_next.h5', compile=False).get_weights())
257+
logger.info("\t <<< Updating model_init from " + model_name + "_init.h5 ... >>>")
258+
model.model_init.set_weights(load_model(model_name + '_init.h5', compile=False).get_weights())
259+
logger.info("\t <<< Updating model_next from " + model_name + "_next.h5 ... >>>")
260+
model.model_next.set_weights(load_model(model_name + '_next.h5', compile=False).get_weights())
261261
elif loading_optimized == 2:
262-
logger.info("\t <<< Updating model_init from " + model_path + "_structure_init.json ... >>>")
263-
model.model_init.load_weights(model_path + '_weights_init.h5')
262+
logger.info("\t <<< Updating model_init from " + model_name + "_structure_init.json ... >>>")
263+
model.model_init.load_weights(model_name + '_weights_init.h5')
264264
# Load model structure
265-
logger.info("\t <<< Updating model_next from " + model_path + "_structure_next.json ... >>>")
265+
logger.info("\t <<< Updating model_next from " + model_name + "_structure_next.json ... >>>")
266266
# Load model weights
267-
model.model_next.load_weights(model_path + '_weights_next.h5')
267+
model.model_next.load_weights(model_name + '_weights_next.h5')
268268

269269
logger.info("<<< Model updated in %0.6s seconds. >>>" % str(time.time() - t))
270270
return model

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from setuptools import find_packages
44

55
setup(name='multimodal-keras-wrapper',
6-
version='3.1.0',
6+
version='3.1.1',
77
description='Wrapper for Keras with support to easy multimodal data and models loading and handling.',
88
author='Marc Bolaños - Alvaro Peris',
99
author_email='marc.bolanos@ub.edu',

0 commit comments

Comments
 (0)