wengong-jin / icml18-jtnn

Junction Tree Variational Autoencoder for Molecular Graph Generation (ICML 2018)
MIT License
509 stars 190 forks source link

No file called model.4 #18

Closed NamanChuriwala closed 6 years ago

NamanChuriwala commented 6 years ago

Dear Wengong: You use the following code to run gen_latent.py in the bo folder.: python gen_latent.py --data ../data/train.txt --vocab ../data/vocab.txt \ --hidden 450 --depth 3 --latent 56 \ --model ../molvae/MPNVAE-h450-L56-d3-beta0.005/model.4 But the system throws the following error: No such file or directory: '../molvae/MPNVAE-h450-L56-d3-beta0.005/model.4 as the file in molvae is named model.iter-4 instead of model.4

I tried passing model-iter.4 instead of model.4 but it still shows an error. Could you help resolve this? Thanks.

wengong-jin commented 6 years ago

Hi,

Sorry for the typo. It should be model-iter.4

So could you tell me what is the error you still have?

NamanChuriwala commented 6 years ago

Hi,

The input dimensions being provided by us to gen_latent.py are not getting inputted into the file through the parser. Instead, one can define the variables and files in the file itself, example hidden_size=450 instead of passing through the parser.

Otherwise, it results in the following error: , line 719, in load_state_dict self.class.name, "\n\t".join(error_msgs))) RuntimeError: Error(s) in loading state_dict for JTNNVAE: size mismatch for embedding.weight: copying a param of torch.Size([780, 200]) from checkpoint, where the shape is torch.Size([780, 450]) in current model. size mismatch for jtnn.embedding.weight: copying a param of torch.Size([780, 200]) from checkpoint, where the shape is torch.Size([780, 450]) in current model. size mismatch for jtnn.W_z.bias: copying a param of torch.Size([200]) from checkpoint, where the shape is torch.Size([450]) in current model. size mismatch for jtnn.W_z.weight: copying a param of torch.Size([200, 400]) from checkpoint, where the shape is torch.Size([450, 900]) in current model. size mismatch for jtnn.W_r.weight: copying a param of torch.Size([200, 200]) from checkpoint, where the shape is torch.Size([450, 450]) in current model. size mismatch for jtnn.U_r.bias: copying a param of torch.Size([200]) from checkpoint, where the shape is torch.Size([450]) in current model. size mismatch for jtnn.U_r.weight: copying a param of torch.Size([200, 200]) from checkpoint, where the shape is torch.Size([450, 450]) in current model. size mismatch for jtnn.W_h.bias: copying a param of torch.Size([200]) from checkpoint, where the shape is torch.Size([450]) in current model. size mismatch for jtnn.W_h.weight: copying a param of torch.Size([200, 400]) from checkpoint, where the shape is torch.Size([450, 900]) in current model. size mismatch for jtnn.W.bias: copying a param of torch.Size([200]) from checkpoint, where the shape is torch.Size([450]) in current model. size mismatch for jtnn.W.weight: copying a param of torch.Size([200, 400]) from checkpoint, where the shape is torch.Size([450, 900]) in current model. size mismatch for jtmpn.W_i.weight: copying a param of torch.Size([200, 40]) from checkpoint, where the shape is torch.Size([450, 40]) in current model. size mismatch for jtmpn.W_h.weight: copying a param of torch.Size([200, 200]) from checkpoint, where the shape is torch.Size([450, 450]) in current model. size mismatch for jtmpn.W_o.bias: copying a param of torch.Size([200]) from checkpoint, where the shape is torch.Size([450]) in current model. size mismatch for jtmpn.W_o.weight: copying a param of torch.Size([200, 235]) from checkpoint, where the shape is torch.Size([450, 485]) in current model. size mismatch for mpn.W_i.weight: copying a param of torch.Size([200, 50]) from checkpoint, where the shape is torch.Size([450, 50]) in current model. size mismatch for mpn.W_h.weight: copying a param of torch.Size([200, 200]) from checkpoint, where the shape is torch.Size([450, 450]) in current model. size mismatch for mpn.W_o.bias: copying a param of torch.Size([200]) from checkpoint, where the shape is torch.Size([450]) in current model. size mismatch for mpn.W_o.weight: copying a param of torch.Size([200, 239]) from checkpoint, where the shape is torch.Size([450, 489]) in current model. size mismatch for decoder.embedding.weight: copying a param of torch.Size([780, 200]) from checkpoint, where the shape is torch.Size([780, 450]) in current model. size mismatch for decoder.W_z.bias: copying a param of torch.Size([200]) from checkpoint, where the shape is torch.Size([450]) in current model. size mismatch for decoder.W_z.weight: copying a param of torch.Size([200, 400]) from checkpoint, where the shape is torch.Size([450, 900]) in current model. size mismatch for decoder.U_r.weight: copying a param of torch.Size([200, 200]) from checkpoint, where the shape is torch.Size([450, 450]) in current model. size mismatch for decoder.W_r.bias: copying a param of torch.Size([200]) from checkpoint, where the shape is torch.Size([450]) in current model. size mismatch for decoder.W_r.weight: copying a param of torch.Size([200, 200]) from checkpoint, where the shape is torch.Size([450, 450]) in current model. size mismatch for decoder.W_h.bias: copying a param of torch.Size([200]) from checkpoint, where the shape is torch.Size([450]) in current model. size mismatch for decoder.W_h.weight: copying a param of torch.Size([200, 400]) from checkpoint, where the shape is torch.Size([450, 900]) in current model. size mismatch for decoder.W.bias: copying a param of torch.Size([200]) from checkpoint, where the shape is torch.Size([450]) in current model. size mismatch for decoder.W.weight: copying a param of torch.Size([200, 228]) from checkpoint, where the shape is torch.Size([450, 478]) in current model. size mismatch for decoder.U.bias: copying a param of torch.Size([200]) from checkpoint, where the shape is torch.Size([450]) in current model. size mismatch for decoder.U.weight: copying a param of torch.Size([200, 428]) from checkpoint, where the shape is torch.Size([450, 928]) in current model. size mismatch for decoder.W_o.weight: copying a param of torch.Size([780, 200]) from checkpoint, where the shape is torch.Size([780, 450]) in current model. size mismatch for decoder.U_s.weight: copying a param of torch.Size([1, 200]) from checkpoint, where the shape is torch.Size([1, 450]) in current model. size mismatch for T_mean.weight: copying a param of torch.Size([28, 200]) from checkpoint, where the shape is torch.Size([28, 450]) in current model. size mismatch for T_var.weight: copying a param of torch.Size([28, 200]) from checkpoint, where the shape is torch.Size([28, 450]) in current model. size mismatch for G_mean.weight: copying a param of torch.Size([28, 200]) from checkpoint, where the shape is torch.Size([28, 450]) in current model. size mismatch for G_var.weight: copying a param of torch.Size([28, 200]) from checkpoint, where the shape is torch.Size([28, 450]) in current model.

NamanChuriwala commented 6 years ago

Hi, Solved the issue, model is running fine now. Although I'm not able to make use of cuda, model is running fine.