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.

output text generator failing at prediction time

See original GitHub issue

Describe the bug Predictions are not produced for trained model

To Reproduce Steps to reproduce the behavior:

  1. run this code to reproduce:
import ludwig
import pandas as pd

model_definition = {
    'input_features':[{
        'name': 'l1',
        'type': 'text',
        'encoder': 'rnn',
        'cell_type': 'lstm',
        'reduce_output': 'None'}],
    'output_features':[{
        'name': 'l2',
        'type': 'text',
        'decoder': 'generator',
        'cell_type': 'lstm',
        'attention': 'bahdanau',
        'loss':{
            'type': 'sampled_softmax_cross_entropy'}}]}

model = ludwig.LudwigModel(model_definition=model_definition)

data_df = pd.DataFrame({
    'l1':['aa ab ac', 'ad ae af'],
    'l2':['za zb zc', 'zd ze zf']})

model_stats = model.train(data_df=data_df)

preds = model.predict(data_df=data_df)
  1. See error:

KeyError Traceback (most recent call last) <ipython-input-2-6af87045705b> in <module> 26 model_stats = model.train(data_df=data_df) 27 —> 28 preds = model.predict(data_df=data_df)

~/.local/lib/python3.5/site-packages/ludwig/api.py in predict(self, data_df, data_csv, data_dict, return_type, batch_size, gpus, gpu_fraction, logging_level) 929 gpus=gpus, 930 gpu_fraction=gpu_fraction, –> 931 logging_level=logging_level, 932 ) 933

~/.local/lib/python3.5/site-packages/ludwig/api.py in _predict(self, data_df, data_csv, data_dict, return_type, batch_size, gpus, gpu_fraction, only_predictions, logging_level) 799 self.model_definition[‘preprocessing’] 800 ) –> 801 replace_text_feature_level(self.model_definition, [preprocessed_data]) 802 dataset = Dataset( 803 preprocessed_data,

~/.local/lib/python3.5/site-packages/ludwig/data/preprocessing.py in replace_text_feature_level(model_definition, datasets) 706 ‘{}_{}’.format( 707 feature[‘name’], –> 708 feature[‘level’] 709 ) 710 ]

KeyError: ‘l2_word’

Expected behavior Predictions are produced

Environment (please complete the following information):

  • OS: Debian GNU/Linux
  • Version: 9
  • Python version: 3.5.3
  • Ludwig version: 0.1.0

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:15

github_iconTop GitHub Comments

1reaction
shrinivaskallolcommented, Apr 10, 2019

Thank you! @w4nderlust I was able to resolve the above issue after upgrading Ludwig to 0.1.1

0reactions
w4nderlustcommented, Apr 9, 2019

Can’t reproduce the error, works fine for me, make sure you have the latest version of ludwig installed

Read more comments on GitHub >

github_iconTop Results From Across the Web

output text generator failing at prediction time #214 - GitHub
Describe the bug. Predictions are not produced for trained model ; To Reproduce Steps to reproduce the behavior: ; Expected behavior. Predictions ......
Read more >
Predicting Generator Failure Issues by Remote Monitoring ...
Text Message. Graphic Display. Monitor Tracks Rate of Change in Preprogrammed Limits to Predict when Limits will be Exceeded. Generator System Monitoring of ......
Read more >
How to Use the TimeseriesGenerator for Time Series ...
In this tutorial, you will discover how to use the Keras TimeseriesGenerator for preparing time series data for modeling with deep learning ...
Read more >
Text generation with an RNN - TensorFlow
This tutorial demonstrates how to generate text using a character-based RNN. You will work with a dataset of Shakespeare's writing from ...
Read more >
Boosting your Sequence Generation Performance with 'Beam ...
A character-level text generator model generates text by ... generate the output sequence by predicting one token (char/ wordbbb) at a time.
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