magic should always look for both keras and tfkeras
@@ -538,12 +538,14 @@ def magic_install():
# store magic_set into config
if magic_set:
wandb.config._set_wandb('magic', magic_set)
+ wandb.config.persist()
+ # Monkey patch both tf.keras and keras
if 'tensorflow.python.keras' in sys.modules:
_monkey_tfkeras(sys.modules.get('tensorflow.python.keras'))
- elif 'keras' in sys.modules:
+ if 'keras' in sys.modules:
_monkey_keras(sys.modules.get('keras'))
- else:
+ # Always setup import hooks looking for keras or tf.keras
if not _import_hook:
_import_hook = ImportMetaHook()
_import_hook.install()
