question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Describe the bug Following along with the tutorial found at : https://ludwig.ai/latest/examples/nlu/

And using the exact same nlu dataset:

ludwig experiment --dataset nlu.csv --config config.yaml nlu.csv

config.yaml

input_features:
    -
        name: utterance
        type: text
        encoder: 
            type: rnn
            cell_type: lstm
            bidirectional: true
            num_layers: 2
            reduce_output: null
        preprocessing:
            tokenizer: space

output_features:
    -
        name: intent
        type: category
        reduce_input: sum
        decoder:
            num_fc_layers: 1
            output_size: 64
    -
        name: slots
        type: sequence
        decoder: 
            type: tagger

error:

.
.
.
File "/home/martin/.virtualenvs/ludwig/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1190, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/martin/.virtualenvs/ludwig/lib/python3.8/site-packages/torch/nn/modules/linear.py", line 114, in forward
    return F.linear(input, self.weight, self.bias)
RuntimeError: mat1 and mat2 shapes cannot be multiplied (2x512 and 256x256)
Training:   0%|   

Issue Analytics

  • State:open
  • Created 10 months ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
justinxzhaocommented, Dec 20, 2022

Hi @martinb-bb, here’s a sample python script you can use:

import logging

import yaml

from ludwig.api import LudwigModel

config = yaml.safe_load("""
input_features:
    -
        name: utterance
        type: text
        encoder: 
            type: rnn
            cell_type: lstm
            bidirectional: true
            num_layers: 2
            reduce_output: null
        preprocessing:
            tokenizer: space

output_features:
    -
        name: intent
        type: category
        reduce_input: sum
        decoder:
            num_fc_layers: 1
            output_size: 64
    -
        name: slots
        type: sequence
        decoder:
            type: tagger

""")

# Define Ludwig model object that drive model training
model = LudwigModel(config=config, logging_level=logging.INFO)

# initiate model training
(
    train_stats,  # dictionary containing training statistics
    preprocessed_data,  # tuple Ludwig Dataset objects of pre-processed training data
    output_directory,  # location of training results stored on disk
) = model.train(dataset="nlu.csv", experiment_name="simple_experiment", model_name="simple_model")

1reaction
justinxzhaocommented, Dec 9, 2022

Hi @martinb-bb,

Thanks for filing the issue!

The shape mismatch is an indication that some modules aren’t being initialized properly. I don’t expect this to be a complicated fix, and we should swap this example out with a larger example.

Next quarter, we are planning to back all of our examples and tutorials with real tests that run as part of our CI which should help keep the examples unbroken.

I’ll plan to look at this more closely by next week.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Training NLU model displays error on developer/personal ...
Upon training the "ITSM NLU for Virtual Agent" on dev/personal instance the following error message: java.lang.Exception: SE0229:Training failed due to: ...
Read more >
Don't Mistake NLU for NLP. Here's Why. | Expert.ai
NLU vs. NLP. Natural language understanding is a subset of natural language processing (or superset in some cases). NLP “analyzes and processes” ...
Read more >
Rasa train nlu error - Rasa Community Forum
I get the following error when I run rasa train nlu: File ... /Versions/3.8/lib/python3.8/site-packages/rasa/nlu/utils/spacy_utils.py”, ...
Read more >
AutoNLU: Detecting, root-causing, and fixing NLU model errors
It adds automation to three key steps: detection, attribution, and correction of model errors, i.e., bugs. We detected four times more ...
Read more >
Error in NLU Server · Discussion #11622 · botpress ... - GitHub
I have a problem with the NLU Server apparently, when I try to train my bot, the nodeJS console prints the next error:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found