ValueError: dictionary update

Hi Forum -

I am running rasa NLU and Core locally on a mac - I am building a bot using the Spacy Portuguese language and have run into this …


Traceback (most recent call last):
  File "nlu_model.py", line 18, in <module>
    train_nlu('./data/data.json', 'config_spacy.json', './models/nlu')
  File "nlu_model.py", line 9, in train_nlu
    trainer = Trainer(RasaNLUModelConfig(config))
  File "/anaconda3/lib/python3.6/site-packages/rasa_nlu/config.py", line 103, in __init__
    self.override(configuration_values)
  File "/anaconda3/lib/python3.6/site-packages/rasa_nlu/config.py", line 180, in override
    self.__dict__.update(config)
ValueError: dictionary update sequence element #0 has length 1; 2 is required

ValueError problems seem like cross-platform problems … and pretty common BUT I can’t find a solution related to using Rasa.

Is there something wrong with my training data? (all the data was added with the RASA javascript trainer tool)

Or

with the Portuguese language implementation?

When is this happening, during training? Also if you’re seeing actual errors, it’s better to create an issue on the NLU github repo. With some more details like what command you’re running etc

Hi Akelad - Thanks VERY MUCH for getting to me.

It is happening when I run - python nlu_model.py

I’m not sure if its an issue or something with my setup - ie trying to use Portuguese ?

Hi @akelad — I am not able to resolve this problem is it because I am using anaconda?

Do you have any suggestion? … anything would be helpful!!

Thx

what does nlu_model.py contain?

HERE is the contents of nlu_model.py


from rasa_nlu.training_data import load_data
from rasa_nlu.config import RasaNLUModelConfig
from rasa_nlu.model import Trainer
from rasa_nlu.model import Metadata, Interpreter


def train_nlu(data, config, model_dir):
    training_data = load_data(data)
    trainer = Trainer(RasaNLUModelConfig(config))
    trainer.train(training_data)
    model_directory = trainer.persist(model_dir, fixed_model_name = 'weathernlu')

def run_nlu():
    interpreter = Interpreter.load('./models/nlu/default/weathernlu', RasaNLUModelConfig('config_spacy.json'))
    print(interpreter.parse(u"Como está o tempo hoje em Oporto?"))

if __name__ == '__main__':
    train_nlu('./data/data.json', 'config_spacy.json', './models/nlu')
    run_nlu()

Does the same error occur when you use the rasa_nlu.train script?

what do you mean? rasa_nlu.train is in our repository, it’s the standard command to train a rasa nlu model

Hey, I have the exact same problem. Did you manage to solve it? Thanks!

i am also get that error while run the nlu_model.py ValueError: dictionary update sequence element #0 has length 1; 2 is required

It’s the same with me. And, how do i configure the config file? It seems to need a dictionay format about config file accoding to the source code.

Hi Sir have you figure out this problem…, because i was facing the same problem…“ValueError: dictionary update sequence element #0 has length 1; 2 is required” if u have please help me out