I was trying to reproduce the blenderbot2 project. I used the following script to train a BB2 model, with an initialization from BB1. I used 'dpr' as the rag-retriever-type here because my server does not support the internet connection.
However, it seems there is something wrong with the memory reading and writing process. The error log is:
loading: /home/ParlAI/data/msc/msc/msc_dialogue/session_2
Traceback (most recent call last):
File "/home/anaconda3/envs/new_ble/bin/parlai", line 33, in <module>
sys.exit(load_entry_point('parlai', 'console_scripts', 'parlai')())
File "/home/ParlAI/parlai/__main__.py", line 14, in main
superscript_main()
File "/home/ParlAI/parlai/core/script.py", line 325, in superscript_main
return SCRIPT_REGISTRY[cmd].klass._run_from_parser_and_opt(opt, parser)
File "/home/ParlAI/parlai/core/script.py", line 108, in _run_from_parser_and_opt
return script.run()
File "/home/ParlAI/parlai/scripts/train_model.py", line 933, in run
return self.train_loop.train()
File "/home/ParlAI/parlai/scripts/train_model.py", line 897, in train
for _train_log in self.train_steps():
File "/home/ParlAI/parlai/scripts/train_model.py", line 804, in train_steps
world.parley()
File "/home/ParlAI/parlai/core/worlds.py", line 865, in parley
batch_act = self.batch_act(agent_idx, batch_observations[agent_idx])
File "/home/ParlAI/parlai/core/worlds.py", line 833, in batch_act
batch_actions = a.batch_act(batch_observation)
File "/home/ParlAI/parlai/core/torch_agent.py", line 2234, in batch_act
output = self.train_step(batch)
File "/home/ParlAI/parlai/core/torch_generator_agent.py", line 734, in train_step
loss = self.compute_loss(batch)
File "/home/ParlAI/projects/blenderbot2/agents/blenderbot2.py", line 833, in compute_loss
loss, output = super().compute_loss(batch, return_output=True)
File "/home/ParlAI/parlai/agents/rag/rag.py", line 885, in compute_loss
model_output = self.get_model_output(batch)
File "/home/ParlAI/parlai/agents/rag/rag.py", line 858, in get_model_output
*self._model_input(batch), ys=batch.label_vec
File "/home/anaconda3/envs/new_ble/lib/python3.7/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/ParlAI/parlai/core/torch_generator_agent.py", line 309, in forward
encoder_states = prev_enc if prev_enc is not None else self.encoder(*xs)
File "/home/ParlAI/projects/blenderbot2/agents/modules.py", line 816, in encoder
segments,
File "/home/ParlAI/projects/blenderbot2/agents/modules.py", line 223, in encoder
num_memory_decoder_vecs,
File "/home/ParlAI/projects/blenderbot2/agents/modules.py", line 382, in retrieve_and_concat
generated_memories,
File "/home/ParlAI/projects/blenderbot2/agents/modules.py", line 556, in access_long_term_memory
for batch_id, mem_id in enumerate(indices)
File "/home/ParlAI/projects/blenderbot2/agents/modules.py", line 556, in <dictcomp>
for batch_id, mem_id in enumerate(indices)
IndexError: index 1 is out of bounds for dimension 0 with size 1
May I ask how to specify the correct BB2 training command? Any suggestion would be much appreciated!
Hi there - the BB2 model is not meant to be trained with a memory decoder (this is usually only for inference/interactive); try setting --memory-decoder-model-file '' and training again
Hi,
I was trying to reproduce the blenderbot2 project. I used the following script to train a BB2 model, with an initialization from BB1. I used 'dpr' as the rag-retriever-type here because my server does not support the internet connection.
However, it seems there is something wrong with the memory reading and writing process. The error log is:
May I ask how to specify the correct BB2 training command? Any suggestion would be much appreciated!