HLTCHKUST / PAML

Personalizing Dialogue Agents via Meta-Learning
MIT License
126 stars 24 forks source link

Problem while loading BERT pre-trained model for the NLI-Scorer #4

Open xhc19930714 opened 5 years ago

xhc19930714 commented 5 years ago

sorry to bother you. I need your help. when I run the command(python MAML.py --cuda --model trs --batch_size 16 --use_sgd --lr 0.01 --meta_lr 0.0003 --meta_batch_size 16 --meta_optimizer adam --pretrain_emb --weight_sharing --emb_dim 300 --hidden_dim 300 --fix_dialnum_train --pointer_gen --save_path save/paml/) I got the following result image so, can you give me some advice on fixing the problem? thx.

xhc19930714 commented 5 years ago

the last error was found in /PAML/utils/load_bert.py", line 325, in init

andreamad8 commented 5 years ago

Have you downloaded the BERT pre-trained model? https://drive.google.com/file/d/1Qawz1pMcV0aGLVYzOgpHPgG5vLSKPOJ1/view?usp=sharing

xhc19930714 commented 5 years ago

Yes, I have already downloaded the BERT pre-trained model and followed your instructions to put the model in the /PAML/data/nli_model/

xhc19930714 commented 5 years ago

image Did you mean this file?

andreamad8 commented 5 years ago

yes, I mean the pytorch_model.bin which yes should be inside the nli_model folder.

So, we never had this error, could you add print(model) before model.to(self.device) this shouldn't be None.

Maybe a version problem? we tested pytorch 4.* and 1.0

xhc19930714 commented 5 years ago

I use conda create command to create an environment, then I run the pip install -r requirements.txt to match your dependencies, and I checked my torch version is 0.4.1.

qiangqiang-he commented 4 years ago

I need help.When I trained successfully.I want to fine-tuned.>>>>[python main_fine_tune.py --cuda --model trs --batch_size 16 --use_sgd --lr 0.01 --meta_lr 0.0003 --meta_batch_size 16 --meta_optimizer adam --pretrain_emb --weight_sharing --emb_dim 300 --hidden_dim 300 --pointer_gen --persona --save_path save/persona/${model} --save_path_dataset save/persona/ --test] It generates error.IsADirectoryError:is a directory:'save/persona'.Even if I checked that 'save/persona' is existed.

imrdong commented 4 years ago

I need help.When I trained successfully.I want to fine-tuned.>>>>[python main_fine_tune.py --cuda --model trs --batch_size 16 --use_sgd --lr 0.01 --meta_lr 0.0003 --meta_batch_size 16 --meta_optimizer adam --pretrain_emb --weight_sharing --emb_dim 300 --hidden_dim 300 --pointer_gen --persona --save_path save/persona/${model} --save_path_dataset save/persona/ --test] It generates error.IsADirectoryError:is a directory:'save/persona'.Even if I checked that 'save/persona' is existed.

Have you take the model with lowest PPL in validation set to finetune and test (replace ${model})

xhc19930714 commented 4 years ago

Hi, I want to know how you trained the code? Did you train the code directly in your environment? I failed to train the code. When I run the code in my env, my GPU memory and utilization rate is very low. Did you modify the code and then run code in your env?

At 2020-08-12 20:54:24, "mrdong" notifications@github.com wrote:

I need help.When I trained successfully.I want to fine-tuned.>>>>[python main_fine_tune.py --cuda --model trs --batch_size 16 --use_sgd --lr 0.01 --meta_lr 0.0003 --meta_batch_size 16 --meta_optimizer adam --pretrain_emb --weight_sharing --emb_dim 300 --hidden_dim 300 --pointer_gen --persona --save_path save/persona/${model} --save_path_dataset save/persona/ --test] It generates error.IsADirectoryError:is a directory:'save/persona'.Even if I checked that 'save/persona' is existed.

Have you take the model with lowest PPL in validation set to finetune and test (replace ${model})

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

imrdong commented 4 years ago

Hi, I want to know how you trained the code? Did you train the code directly in your environment? I failed to train the code. When I run the code in my env, my GPU memory and utilization rate is very low. Did you modify the code and then run code in your env? At 2020-08-12 20:54:24, "mrdong" notifications@github.com wrote: I need help.When I trained successfully.I want to fine-tuned.>>>>[python main_fine_tune.py --cuda --model trs --batch_size 16 --use_sgd --lr 0.01 --meta_lr 0.0003 --meta_batch_size 16 --meta_optimizer adam --pretrain_emb --weight_sharing --emb_dim 300 --hidden_dim 300 --pointer_gen --persona --save_path save/persona/${model} --save_path_dataset save/persona/ --test] It generates error.IsADirectoryError:is a directory:'save/persona'.Even if I checked that 'save/persona' is existed. Have you take the model with lowest PPL in validation set to finetune and test (replace ${model}) — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

Hi, I trained the code in a virtual environment which match the dependencies in the requirements.txt, I do modify the code as there are some errors when I trained the code, but the errors I encountered are not the errors you mentioned, maybe you can try to run the code on another machine ranther than create a virtual environment on the same machine, and see what happens.

xhc19930714 commented 4 years ago

I have successfully trained all the PAML、 no_persona and persona models. Then I have fine-tuned the no-persona and persona models successfully. As for the paml model, when I have finished training the paml model , there is no model exist in the path ./save/paml like the other two. Should I have check the source code and fix them by myself, or maybe you have missed uploading some key code in the file MAML.py?

leyi-123 commented 3 years ago

sorry to bother you. I need your help. when I run the command(python MAML.py --cuda --model trs --batch_size 16 --use_sgd --lr 0.01 --meta_lr 0.0003 --meta_batch_size 16 --meta_optimizer adam --pretrain_emb --weight_sharing --emb_dim 300 --hidden_dim 300 --fix_dialnum_train --pointer_gen --save_path save/paml/) I got the following result image so, can you give me some advice on fixing the problem? thx.

Hi! I have the same problem as you. Can I ask how you solved it? Thanks!

ghost commented 3 years ago

Hi, I want to konw what's the purpose of data_analysis.ipynb?Is it necessary for the code?Is there another way to get persona_map file

SungWeiTseng commented 1 year ago

Yes, I have already downloaded the BERT pre-trained model and followed your instructions to put the model in the /PAML/data/nli_model/

I'm sorry to bother you, the original link provided by the owner is no longer valid. If it's not too much trouble and you still have the model file, could you please share it with me?