SivilTaram / Persona-Dialogue-Generation

The code of ACL 2020 paper "You Impress Me: Dialogue Generation via Mutual Persona Perception"
MIT License
309 stars 46 forks source link

ValueError: not enough values to unpack -interactive.py #36

Open MagicDinosaur opened 2 years ago

MagicDinosaur commented 2 years ago

Hi! Thank you for your research contribution. So far i have downloaded and unzip the "Trained Model Weights- Original setting", but I got a problem when trying to run your interactive.py file. """Traceback (most recent call last): File "/content/Persona-Dialogue-Generation/interactive.py", line 141, in interactive(parser.parse_args(print_args=False), print_parser=parser) File "/content/Persona-Dialogue-Generation/interactive.py", line 121, in interactive acts[1] = agents[1].act() File "/content/Persona-Dialogue-Generation/agents/transmitter/transmitter.py", line 901, in act return self.batch_act([self.observation])[0] File "/content/Persona-Dialogue-Generation/agents/transmitter/transmitter.py", line 857, in batch_act self.init_cuda_buffer(batchsize) File "/content/Persona-Dialogue-Generation/agents/transmitter/transmitter.py", line 842, in init_cuda_buffer sc = self.model(input_dummy, None, None, output_dummy, None)[1] File "/usr/local/lib/python3.7/dist-packages/torch/nn/modules/module.py", line 489, in call result = self.forward(*input, **kwargs) File "/content/Persona-Dialogue-Generation/agents/transmitter/gpt/model.py", line 91, in forward lm_logits, hidden_states = self.transformer_module(input_seq, None, dis_seq) ValueError: not enough values to unpack (expected 2, got 1)""" Could you take a look at it and instruct me how to run it properly? Because i am pretty new to this area. Thank you so much in advance

SivilTaram commented 2 years ago

@MagicDinosaur Hi, thanks for you interest on our work. The issue may be because you do not install the correct environment dependency.

parthushah8 commented 2 years ago

Hello @SivilTaram! Thanks for the wonderful work, I am working on a project to extend your approach and was trying to replicate your work but even I faced the same issue. It had also been asked on StackOverflow where the answer mentioned that the OpenAIGPTLMHeadModel only returns lm_logits and not hidden_states.

I suppose it's because of the incorrect environment setup, but I don't understand why that's the case, I followed the steps mentioned in your readme.

  1. I created a conda environment with python=3.8, pytorch=1.0.1, and tensorboardX.
  2. Next, I cloned both the transformer and the ParlAI and set it up. Note: One thing to note here is that while setting up the ParlAI repo, with Python 3.7 it gave a runtime error while setting up at the very end: RuntimeError: Scikit-learn requires Python 3.8 or later. but I installed it separately.
  3. Then I had to also install the pytorch-pretrained-bert v0.6.2 as it was not available in the virtual environment. So I ran, pip install pytorch-pretrained-bert==0.6.2. But I am assuming that this is where the issue may have crept in as the older version of OpenAIGPTLMHeadModelmay have returned both the lm_logits, and hidden_states.

Do I have to add the path of the transformer library somewhere? Or am I missing anything?

Your help would be really appreciated, as we plan to extend this project, and replicating such a complex model from scratch will take us a very long time.

SivilTaram commented 1 year ago

@parthushah8 oh sorry for the late response! I have updated the README in Nov 2022. You may check it out if you still need it. Thanks!

abbyzak commented 1 year ago

same issue