XiangLi1999 / Diffusion-LM

Diffusion-LM
Apache License 2.0
1.02k stars 133 forks source link

Issue while generating controllable text generation #69

Open heychhavi opened 8 months ago

heychhavi commented 8 months ago

!python improved-diffusion/scripts/infill.py --model_path "/content/gdrive/MyDrive/Diffusion-LM/improved-diffusion/diffusion_models/ema_0.9999_200000.pt" --evaltask 'control_tree' --use_ddim True --notes "tree_adagrad" --eta 1. --verbose pipe The error message is as follows: /content/gdrive/MyDrive/Diffusion-LM/improved-diffusion/diffusion_models/training_args.json Logging to /tmp/openai-2023-11-25-17-02-56-623447 False clip_denoised creating model and diffusion... creating model, based on transformer BertConfig { "_name_or_path": "bert-base-uncased", "architectures": [ "BertForMaskedLM" ], "attention_probs_dropout_prob": 0.1, "classifier_dropout": null, "gradient_checkpointing": false, "hidden_act": "gelu", "hidden_dropout_prob": 0.1, "hidden_size": 768, "initializer_range": 0.02, "intermediate_size": 3072, "layer_norm_eps": 1e-12, "max_position_embeddings": 512, "model_type": "bert", "num_attention_heads": 12, "num_hidden_layers": 12, "pad_token_id": 0, "position_embedding_type": "absolute", "transformers_version": "4.35.2", "type_vocab_size": 2, "use_cache": true, "vocab_size": 30522 }

LossType.E2E_MSE False training mode is e2e training mode is e2e Traceback (most recent call last): File "/content/gdrive/MyDrive/Diffusion-LM/improved-diffusion/scripts/infill.py", line 766, in args = main() ^^^^^^ File "/content/gdrive/MyDrive/Diffusion-LM/improved-diffusion/scripts/infill.py", line 54, in main model.load_state_dict(th.load(args.model_path)) File "/usr/local/lib/python3.11/site-packages/torch/nn/modules/module.py", line 2152, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for TransformerNetModel2: size mismatch for word_embedding.weight: copying a param with shape torch.Size([821, 16]) from checkpoint, the shape in current model is torch.Size([11043, 128]). size mismatch for lm_head.weight: copying a param with shape torch.Size([821, 16]) from checkpoint, the shape in current model is torch.Size([11043, 128]). size mismatch for lm_head.bias: copying a param with shape torch.Size([821]) from checkpoint, the shape in current model is torch.Size([11043]). size mismatch for input_up_proj.0.weight: copying a param with shape torch.Size([768, 16]) from checkpoint, the shape in current model is torch.Size([768, 128]). size mismatch for output_down_proj.2.weight: copying a param with shape torch.Size([16, 768]) from checkpoint, the shape in current model is torch.Size([128, 768]). size mismatch for output_down_proj.2.bias: copying a param with shape torch.Size([16]) from checkpoint, the shape in current model is torch.Size([128]).