Composer icon indicating copy to clipboard operation
Composer copied to clipboard

Errors with VAE

Open kramer69 opened this issue 5 years ago • 1 comments

There are several errors I got when I trained using the VAE mode. The first training had no problems at all and it ran smoothly. However, after I tried to use live_edit on the result, it says that global name VAE_B1 is not defined, then I tried to continue training and got the same error. I solved this by defining VAE_B1 inside the function. This solved the problem but raised another error. I trained it from scratch, and when I tried to continue the training, what I got is ValueError: Unknown loss function:vae_loss

kramer69 avatar Jul 13 '19 00:07 kramer69

Yeah, that mode was something I experimented with briefly, but stopped pursuing when it didn't work as well, so the code probably rotted a bit.

To get it to work, when loading a model it should look like this, where custom_objects contains the custom definitions:

custom_objects = {'vae_loss': vae_loss, 'vae_sampling': vae_sampling}
model = load_model('model.h5', custom_objects=custom_objects)

HackerPoet avatar Jul 13 '19 07:07 HackerPoet