YannDubs / disentangling-vae

Experiments for understanding disentanglement in VAE latent representations
Other
785 stars 143 forks source link

A few snags #48

Closed cclough closed 5 years ago

cclough commented 5 years ago

Apologies if the following are just me not configuring properly:

  1. I'm not seeing Gifs/Pngs being created in the model directory with e.g. python main.py factor_celeba_cc -x factor_celeba -d celeba -l factor. I'd love to have these created every epoch

  2. when i try to evaluate after stopping a training run I get ization.py", line 382, in load f = open(f, 'rb') FileNotFoundError: [Errno 2] No such file or directory: 'results/best_celeba/model.pt' To work around I then rename the e.g. model-100.pt in the model directory to model.pt, then I get 21:50:09 INFO - main: Root directory for saving and loading experiments: results/ best_celeba Traceback (most recent call last): File "main.py", line 252, in <module> main(args) File "main.py", line 233, in main test_loader = get_dataloaders(metadata["dataset"], KeyError: 'dataset'

Incidently when i run e.g. python main_viz.py best_celeba gif-traversals reconstruct-traverse -c 7 -r 6 -t 2 --is-posterior I get the same KerError: 'dataset' error

Thanks for the fantastic repo though!

YannDubs commented 5 years ago

Hi,

Glad you find the repo useful.

  1. The training gif is generated at the end of the training with one image for every epoch. Are you saying that this is not working on your side, or that you'd like the gif to be stored after every epoch?

A quick workaround for the latter case is to change line 96-97 in disvae/training.py :

for epoch in range(epochs):
    ....
if self.gif_visualizer is not None:
    self.gif_visualizer.save_reset()

to

for epoch in range(epochs):
    ....
    if self.gif_visualizer is not None:
        self.gif_visualizer.save()

if self.gif_visualizer is not None:
    self.gif_visualizer.reset()

which basically saves the whole gif at every epoch. Do you want this feature in order to have the gif in case you exit the training with ctrl-c or to check how what the model is learning while training?

  1. Right now we have to wait until the end of training to enable visualization and evaluation. This is because we only save the metadata at the end of training (which is not necessary). Quick workaround, line 190 of main.py add: save_metadata(vars(args), exp_dir) where save_metadata is improted from modelIO. I.e. line 10 of main.py should be from disvae.utils.modelIO import save_model, load_model, load_metadata,save_metadata.

Let me know if it works, and if others show interests in those features i'll add them in the repo.

Hope that helps.